Crystal Reports for Eclipse Designer Guide

ToWords

Description
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.
Overloads
  • ToWords (x)
  • ToWords (x, #places)
  • ToWords (x, #places, formtype)
  • Arguments
  • x is a Number or Currency value to be converted into words.
  • #places is a whole number indicating the number of decimal places to be converted. (This argument is optional.)
  • formtype specifies what type of form x is. This argument is used only for Asian languages—specifically, Japanese, Korean, Simplified Chinese, and Traditional Chinese. It is ignored for English or any other non-Asian language.
    Form Type 0
    Classic form, also called the check form
    Form Type 1
    Daily form
    Form Type 2
    Casual form
    Note:
    • The daily form has the same structure as the classic form, except it uses a different set of characters for the numbers. In Korean, there is only one set of characters for numbers, so the daily form and the classic form are the same for this language. The daily form is also similar to the style used in articles.
    • The casual form is used for quoting phone numbers, addresses, and so on.
  • 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
    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.



  • SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/