Class: NumberConverter

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

QuickNav

NumberConverter extends oj.Converter

Version:
  • 5.0.0
Since:
  • 0.6
Module:
  • ojvalidation-number

Constructor

(abstract) new 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}

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

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