top of page
This computation formats a number variable, Amount-n, in the form "Nine Dollars and Twelve Cents." If, however, there is no cent value, the computation will trim off the string " and No Cents," returning only the dollar amount. For example:
$5.06 - Five Dollars and Six Cents
$5.00 - Five Dollars
To accomplish this, the computation is first set to the value of the number variable nAmount formatted as "Nine Dollars and Twelve Cents." We then look at this string (it is stored in RESULT) to see if its last 13 characters are " and no cents." If so, we trim off that part of the string. To do this, we take only the FIRST x characters of the string, where x is the length of the string - 13.
bottom of page