Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include Dollars and Cents in Towords conversion 1

Status
Not open for further replies.

wld1957

Technical User
Feb 3, 2006
68
US
I have been trying to take a numeric number $48,000.00 and convert it to words. I can do that with the towards function. However I have been stuck on getting it to be able to print "Dollars" and "Cents" in the output.
Example of What I want: One Dollar and xx/36 Cents
This is the forumua that I have been working with.
Propercase(ToWords({sys_trac.trackamt})& "Dollars") & " Cents"

I have not been able to get the word "Dollars" to fit correctly. Any help would be greatly appreciated. Thanks in advance (still learning).
 
So you intend to convert 48,000 to one dollar and xx/36 cents? xx/36 cents, wht sort of notation is that???

You need to adjust your crack intake ;)

This is probably what you want:

// Return the cents as words, not fraction:
whileprintingrecords;
numbervar MyValue:= 48900.17;
towords(int(MyValue),0) & " dollars " & towords((MyValue-int(MyValue))*100,0) & " cents"

-k
 
Sorry for the confusion. Your solution works well. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top