Class: NumberConverter

Oracle® JavaScript Extension Toolkit (JET)
9.0.0

F24343-01

Signature:

abstract class NumberConverter implements Converter<number>

QuickNav

NumberConverter

Version:
  • 9.0.0
Since:
  • 0.6.0
Module:
  • ojconverter-number

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojconverter-number'], function(converterNumber) {
 // Application should call API on converterNumber.NumberConverter 
})
Typescript Import Format
//To import this class, use the format below.
import {NumberConverter} from "ojs/ojconverter-number";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

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