Usage
Signature:
abstract class NumberConverter implements Converter<number>
Typescript Import Format
//To import this class, use the format below.
import {NumberConverter} from "ojs/ojconverter-number";
For additional information visit:
- See:
-
- oj.IntlNumberConverter JET's implementation of the NumberConverter
- See:
-
- oj.IntlNumberConverter JET's implementation of the NumberConverter
Methods
-
format(value) : {string|null}
-
Formats the Number value using the options provided and returs a String value.
Parameters:
Name Type Description value
number the value to be formatted for display Throws:
a ConverterError if formatting fails.- Type
- Error
Returns:
the localized and formatted value suitable for display
- Type
- string | null
-
getHint(): string|null
-
Returns a hint that describes the converter format expected.
- Inherited From:
Returns:
a hint describing the format the value is expected to be in.
- Type
- string | null
-
getOptions(): object
-
Returns the options called with converter initialization.
- Inherited From:
Returns:
an object of options.
- Type
- Object
-
parse(value) : {number|null}
-
Parses the value using the options provided and returns a Number object.
Parameters:
Name Type Description value
string to parse Throws:
a ConverterError if parsing fails- Type
- Error
Returns:
the parsed value as a Number object.
- Type
- number | null
-
resolvedOptions(): object
-
Returns an object literal with locale and formatting options computed during initialization of the object. If options was not provided at the time of initialization, the properties will be derived from the locale defaults.
- Inherited From:
Returns:
an object of resolved options.
- Type
- Object