{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

ToWords

Converts a numeric value or currency to words so it can be used in texts. The number of decimal places can be set. By default, the function converts the integer part into words and shows the fraction as digits (e.g. "and 57 / 100"). With the optional parameter decimalAsWords, the decimal part can also be written in words.

The conversion depends on the language on the client, if the value of the property "Use Client Locale" is true. You can find it in the configuration manager category "General Options".

Supported Languages:

The following languages are currently supported:

  • Chinese (Simplified)
  • Chinese (Traditional)
  • English
  • English (India)
  • French
  • German
  • Hungarian
  • Indonesian
  • Polish
  • Portuguese (Brazil)
  • Russian
  • Serbian
  • Serbian (Latn)
  • Spanish
  • Thai
  • Turkish

We can add more languages in the short term, if we can get the necessary information for the required language, e.g., from a native speaker.

Usage:

ToWords(value)
ToWords(value, places)
ToWords(value, places, locale)
ToWords(value, places, locale, decimalAsWords)

Parameters:

value A number or currency that should be converted to string
places An optional value indicating the number of decimal places to be converted, default is 2
locale An optional value with the ISO 639-1 language code to set the conversion language. A language code is a lower-case, two-letter code as defined by ISO-639. You can find a full list of these codes at a number of sites, such as:http://www.loc.gov/standards/iso639-2/php/English_list.php (the last column)
Default is the current resource locale.
decimalAsWords An optional boolean. If true, the decimal part is also converted to words (e.g. "and forty-five hundredths" or language-specific equivalents). If false or omitted, the decimal part is shown as digits (e.g. "and 45 / 100"). Default is false.

Returns:

String

Examples:

ToWords(7) // Returns "seven and xx/100".
ToWords(7,3)// Returns "seven and xx/1000".
ToWords(732.573,2) // Returns "seven hundred thirty-two and 57 / 100".
ToWords(732.573,0,"en-US") // Returns "seven hundred thirty-two" in any environment
ToWords(value,0)+" euro "+ToWords((value-Truncate(value))*100,0)+" cent" // Returns "twelve euro thirty-four cent" for 12.34
ToWords(100.45, 2, "en", true) // Returns the integer and decimal parts in words, e.g. "one hundred and forty-five hundredths".

See also:

i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help