/** * Returns a new <code>float</code> initialized to the value * represented by the specified <code>Strng</code>, as performed * by the <code>valueOf</code> method of class <code>Float</code>. * * @param \AppserverIo\Lang\Strng $string She string to be parsed * * @return float The <code>float</code> value represented by the string argument * @exception \AppserverIo\Lang\NumberFormatException If the string does not contain a parsable <code>float</code>. * @see \AppserverIo\Lang\Flt::valueOf($string) */ public static function parseFloat(Strng $string) { return Flt::valueOf($string)->floatValue(); }
/** * This test checks the Float's valueOf() method. * * @return void */ public function testValueOfWithNumberFormatException() { // set the expected exception $this->setExpectedException('\\AppserverIo\\Lang\\NumberFormatException'); // initialize a new Float instance $int = Flt::valueOf(new Strng('!17')); }