format.getCurrencyFormatter(options)

Note:

The content in this help topic pertains to SuiteScript 2.0.

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

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

Since

options.currency

string

required if options.locale is not specified

Code of the currency that is used by formatter.

2019.2

options.locale

string

required if options.currency is not specified

Code of the locale that is used by formatter.

2021.1

Warning:

These parameters are mutually exclusive, you can always use only one of them.

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

Related Topics

N/format/i18n Module
SuiteScript 2.x Modules
SuiteScript 2.x

General Notices