NumberFormatter.format(options)

Method Description

Format number to the number string.

Returns

String

Supported Script Types

Client and server scripts

For more information, see SuiteScript 2.x Script Types.

Governance

10 units

Module

N/format/i18n Module

Methods and Properties

N/format/i18n Module Members

Since

2019.2

Parameters

Note:

The options parameter is a JavaScript object.

Parameter

Type

Required / Optional

Description

options.number

number

required

The number to be formatted

Syntax

Important:

The following code snippet shows the syntax for this member. It is not a functional example. For a complete script example, see N/format/i18n Module Script Samples.

              // Add additional code
...
var numFormatter = format.getNumberFormatter({
    groupSeparator: " ", 
    decimalSeparator: ",", 
    precision: 2, 
    negativeNumberFormat: format.NegativeNumberFormat.MINUS
}); 
var formattedNum = numFormatter.format({
    number: 12845.22
});
// formattedNum will be '12 845,22'
...
// Add additional code 

            

Related Topics

General Notices