LocalizeSpellout (open)
Format a numerical value as spelled out text
Syntax
LOADLIB "wh::util/localization.whlib";
STRING FUNCTION LocalizeSpellout(INTEGER64 value, STRING locale)
Parameters
INTEGER64 value
The value to spell out
STRING locale
The language or locale to use (e.g. 'en', 'en-GB', 'nl' or 'zh-Hans-CN')
Return value
STRING
The formatted value
Examples
// example1 = "twelve thousand three hundred forty-five"
STRING example1 := LocalizeSpellout(12345, "en");
// example2 = "negenhonderdnegenennegentig miljard negenhonderdnegenennegentig miljoen negenhonderdnegenennegentigduizendnegenhonderdnegenennegentig"
STRING example2 := LocalizeSpellout(999999999999i64, "nl");
// example3 = "minus eine Million"
STRING example3 := LocalizeSpellout(-1000000, "de");