format.getCurrencyFormatter(options)
Method Description |
Creates a format.CurrencyFormatter object to format numbers into currency strings. |
Returns |
Object |
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.
These parameters are mutually exclusive, you can always use only one of them.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
string |
required if |
Code of the currency that is used by formatter. |
2019.2 |
|
string |
required if |
Code of the locale that is used by formatter. |
2021.1 |
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: "EUR"
});
var locale_curFormatter = format.getCurrencyFormatter({
locale: "IT_IT"
});
...
// Add additional code
Errors
Error Code |
Thrown If |
---|---|
SSS_MISSING_REQD_ARGUMENT |
Currency parameter is missing |
SSS_INVALID_CURRENCY |
The currency is not valid |
SSS_INVALID_TYPE_ARG |
The parameter type is wrong |
NEITHER_ARGUMENT_DEFINED |
Both parameters are missing |
MUTUALLY_EXCLUSIVE_ARGUMENTS |
Multiple mutually exclusive parameters have been set as required or optional |
INVALID_LOCALE |
The locale is not valid |