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 |
|
Methods and Properties |
|
Since |
2019.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
---|---|---|---|
|
number |
required |
The number to be formatted |
Syntax
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