NumberFormat.parse

NumberFormat.parse

Class Overview | Class Members | This Package | All Packages

Syntax 1
public abstract Number parse( String text, ParsePosition parsePosition )
Description
Returns a Long if possible (e.g. within range [Long.MIN_VALUE, Long.MAX_VALUE], and with no decimals), otherwise a Double. If IntegerOnly is set, will stop at a decimal point (or equivalent; e.g. for rational numbers "1 2/3", will stop after the 1). Does not throw an exception; if no object can be parsed, index is unchanged!

See Also
isParseIntegerOnly, parseObject



Syntax 2
public Number parse( String text ) throws ParseException
Description
Convenience method.

Exceptions
ParseException if the specified string is invalid.
See Also
format