Class jsworld.NumericParser
Class for parsing localised number strings.
Defined in: <JsWorld.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
jsworld.NumericParser(locale)
Creates a new numeric parser for the specified locale.
|
| Method Attributes | Method Name and Description |
|---|---|
|
parse(formattedNumber)
Parses a numeric string formatted according to the
preset locale.
|
Class Detail
jsworld.NumericParser(locale)
Creates a new numeric parser for the specified locale.
- Parameters:
- {jsworld.Locale} locale
- A locale object specifying the required POSIX LC_NUMERIC formatting properties.
- Throws:
- Error on constructor failure.
Method Detail
{Number}
parse(formattedNumber)
Parses a numeric string formatted according to the
preset locale. Leading and trailing whitespace is ignored; the number
may also be formatted without thousands separators.
- Parameters:
- {String} formattedNumber
- The formatted number.
- Throws:
- Error on a parse exception.
- Returns:
- {Number} The parsed number.