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

number format question

Status
Not open for further replies.
Jul 21, 2001
102
US
Crystal 9, Oracle

I would like 1,200,000 to appear as 1.2 million but can't find the solution in the number formatting options except for selecting decimal point as the thousands separator symbol.
 
If the field is always in the millions, then you could use:

totext({table.number}/1000000,1,"") +" million"

If the number is not always in the millions, please provide sample results that include all possible variations.

-LB
 
It's been a while since I've used the function, and I don't have Crystal here, but there is a towords function (something like that) which converts currency to text in the form of writing a check, if that helps.

Otherwise if you're always looking to express it as millions only, you can use LB's solution.

Or elaborate on it:

If {tabe.field} >= 1000000 then
totext({table.number}/1000000,1,"") +" million"
else If {tabe.field} >= 100000 then
totext({table.number}/100000,1,"") +" hundred thousand"
else If {tabe.field} >= 1000 then
totext({table.number}/1000,1,"") +" thousand"
else If {tabe.field} >= 100 then
totext({table.number}/100,1,"") +" hundred"

Adjust the amount of decimals you wish to display for each using the 2 parameter of the totext function.

Something like that...

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top