### ToWords (x), ToWords (x, #places)

Basic and Crystal syntax.

##### Arguments

- x is a fractional Number to be converted into words.
- #places is a whole number indicating the number of decimal places to be converted. (This argument is optional.)

##### Returns

Text String

##### Action

You can use this function to convert a Number or Currency field value or the result of a numeric calculation to words so it can be used as text. The ability to adjust the number of decimal places can be useful when the number is the result of a calculation that may produce more decimal places than you want.

##### Typical uses

You can use this function to spell out the dollar amount for each check if you are using computer checks.

##### Examples

The following examples are applicable to both Basic and Crystal syntax:

`ToWords(12345)`

Returns twelve thousand three hundred forty-five and xx/100.

`ToWords(12345.6749,2)`

Returns twelve thousand three hundred forty-five and 67/100.

`ToWords(12345.4999,0)`

Returns twelve thousand three hundred forty-five.

`ToWords(12345.5000,0)`

Returns twelve thousand three hundred forty six.

`ToWords(-12345)`

Returns negative twelve thousand three hundred forty-five and xx/100.

`ToWords(12.3499)`

Returns twelve and 35/100.

`ToWords({orders.ORDER AMOUNT})`

Returns two thousand sixteen and 84/100 where Amount = 2016.84.

`ToWords((({file.QTY1} + {file.QTY2} + {file.QTY3}) * {file.PRICE}) * 1.075)`

Returns one hundred two and 13/100.

`ToWords((({file.QTY1} + {file.QTY2} + {file.QTY3}) * {file.PRICE}) * 1.075,0)`

Returns one hundred two where QTY1 = 1, QTY2 = 82, QTY3 = 12, and Price = 1.00 (sums three quantities, multiplies them times the price and adds 7.5% sales tax). In this case the numeric answer is 102.125 which is then rounded to 102.13 (the standard two decimal places) before putting into words.

##### Comments

- The function treats the number as a whole, rather than as a series of individual numbers. That is, 123 is treated as the number one hundred twenty-three rather than the individual digits one, two, and three.
- Negative numbers begin with the word "negative."
- Currency field values and Number field values are treated in the same way and produce identical results.
- Since the spelled out value will be much longer than the Number value, you will need to increase the size of the field box to accommodate the new field length.

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com