XFA Specification
Chapter 23, FormCalc Specification
String Built-in Functions
892
WordNum()
This function returns the English text equivalent of a given number.
Syntax
WordNum(n1 [, n2 [, k1]])
Parameters
n1
is the number to be converted.
n2
identifies the format option as one of the following:
- if the value is 0, the number is converted into text representing the simple number.
- if the value is 1, the number is converted into text representing the monetary value with no fractional
digits.
- if the value is 2, the number is converted into text representing the monetary value with fractional digits.
If n2 is omitted, the default value of 0 will be used.
k1
is a locale identifier string, as described in
“Specifying a Locale (Locale Identifier String)” on page 828.
If k1 is omitted, the default en_US locale is used.
Note:
This argument is currently ignored.
WordNum()
can be used only in English-speaking locales.
Returns
The English text, or null if any of its parameters are null.
If n1 is not numeric or the integral value of n1 is negative or greater than 922,337,203,685,477,550 the
function returns "*" (asterisk) characters to indicate an error condition.
Bugs
By specifying a locale identifier other than the default, it should be possible to have this function return
something other than English text. However the language rules used to implement this function are
inherently English. Thus, for now, the locale identifier is ignored.
Examples
WordNum(123.54)
returns "One Hundred Twenty-three".
WordNum(1011.54, 1)
returns "One Thousand Eleven Dollars".
WordNum(73.54, 2)
Home Index Bookmark Pages
Pages: Home Index All Pages