Format 12345 as a German String
The following sample spells out the number 12345 as a string in German, “zwölftausenddreihundertfünfundvierzig”.
Note:
This sample script uses the require function so that you can copy it into the SuiteScript Debugger and test it. You must use the define function in an entry point script (the script you attach to a script record and deploy). For more information, see SuiteScript 2.x Script Basics and SuiteScript 2.x Script Types.
/**
* @NApiVersion 2.x
*/
require(['N/format/i18n'], function(format) {
var spellOut = format.spellOut({
number: 12345,
locale: "DE"
});
// spellOut is 'zwölftausenddreihundertfünfundvierzig'
});
Related Topics
- N/format/i18n Module Script Samples
- Format a Number as a String Using N/format/i18n
- Format Numbers as Currency Strings
- Parse a Czech Phone Number
- Parse a U.S. Phone Number
- Format Numbers Based on the Locale Parameter
- Format Currency Based on the Locale Parameter
- Format Numbers and Currencies Based on the English-India Locale Parameter
- SuiteScript 2.x Modules
- SuiteScript 2.x