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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Currency FOrmat

Status
Not open for further replies.

jnujella

Programmer
Joined
Feb 15, 2007
Messages
15
Location
US
Hi all,

I am using crystal reports version XI.
I want to format a number field so that it will be displayed as follows

789.99 - *****$789.99*
1234.90 - ****$1234.90*

I also want to spell the amount like

789.99 as "seven hundred eighty nine& 99/100"
1234.90 as "one thousand two hundred thirty four & 90/100"

Thanks in advance
 
For the first result, create a formula like this:

replicatestring("*", 12-len(totext({table.amt},2,"")))+totext({table.amt},2,"")+"*"

For the second, use:

replace(towords(tonumber({table.amt}))," and"," &")

Note the space before " and"--to distinguish the word and from the "and" that occurs in "thousand".

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top