N/format/i18n Module
Use the N/format/i18n module to format strings in international context and format numbers to currency or number strings. You can also use this module to format phone number to strings and parse strings to phone number.
In This Help Topic
N/format/i18n Module Members
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Client and server scripts |
Represents the object that formats the number to currency string. |
|
Object |
Client and server scripts |
Represents the object that formats the number to string. |
||
Object |
Client and server scripts |
Represents the object that formats the phone number to string. |
||
Object |
Client and server scripts |
Represents the object that parses the string to phone number. |
||
Method |
string |
Client and server scripts |
Creates a string containing the spelled-out version of the specified number in a specified locale. |
|
object |
Client and server scripts |
Create the format.CurrencyFormatter object to format numbers to currency strings. |
||
object |
Client and server scripts |
Create the format.NumberFormatter object to format numbers to strings. |
||
Enum |
enum |
Client and server scripts |
Holds the values for the negative number format. |
|
enum |
Client and server scripts |
Holds the values for the currency code. |
Currency Formatter Object Members
The following members are called on the format.CurrencyFormatter object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string |
Client and server scripts |
Indicates the currency code. |
|
string |
Client and server scripts |
The locale of the currency formatter. |
||
string |
Client and server scripts |
Indicates the currency symbol. |
||
object |
Client and server scripts |
Contains the format.NumberFormatter object derived from format.CurrencyFormatter with the same number formatting parameters without currency symbol. |
||
string |
Client and server scripts |
Formats the number to the currency string. |
Number Formatter Object Members
The following members are called on the format.NumberFormatter object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Property |
string |
Client and server scripts |
Indicates the group separator. |
|
string |
Client and server scripts |
Indicates the decimal separator. |
||
string |
Client and server scripts |
The locale of the number formatter. |
||
number |
Client and server scripts |
Indicates the precision. |
||
enum |
Client and server scripts |
Indicates the negative number format. |
||
string |
Client and server scripts |
Formats the number to string. |
Phone Number Formatter Object Members
The following members are called on the format.PhoneNumberFormatter object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Client and server scripts |
The object that formats the phone number to string. |
|
Method |
string |
Client and server scripts |
Formats phone number object to string. |
|
Enum |
Enum |
Client and server scripts |
Holds the values for the phone number format type. |
|
Enum |
Client and server scripts |
Hold the values for the countries. |
Phone Number Parser Object Members
The following members are called on the format.PhoneNumberParser object.
Member Type |
Name |
Return Type / Value Type |
Supported Script Types |
Description |
---|---|---|---|---|
Object |
Object |
Client and server scripts |
The object that parses the string to phone number. |
|
Method |
Object of type |
Client and server scripts |
Parses string to phone number. |