CurrencyFormatter.format(options)
Method Description |
Formats the number to the currency 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 curFormatter = format.getCurrencyFormatter({
currency: "USD"
});
var formattedCurrency = curFormatter.format({
number: 12.53
});
// formattedCurrency is '$12.53'
...
// Add additional code