Class: NumberConverter

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

oj. NumberConverter extends oj.Converter

Version:
  • 3.2.0
Since:
  • 0.6

Constructor

new NumberConverter()

Source:

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
Source:
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:
Source:
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:
Source:
Returns:
an object of options.
Type
Object

Init(options)

Initializes the number converter instance with the set options.
Parameters:
Name Type Argument Description
options Object <optional>
an object literal used to provide an optional information to initialize the converter.

Source:

parse(value) → {Number}

Parses the value using the options provided and returns a Number object.
Parameters:
Name Type Description
value String to parse
Source:
Throws:
a ConverterError if parsing fails
Type
Error
Returns:
the parsed value as a Number object.
Type
Number

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:
Source:
Returns:
an object of resolved options.
Type
Object