# Crystal Reports - Currency formatting for large amounts

I wish to format currency in my report to make large amounts appear as following:
\$1,200,000   would appear as \$1.2M
\$400,000 would appear as \$400K
\$10,000 would appear as 10K

My numbers do not get into billions  :)
Crystal Reports

Last Comment
James0628

8/22/2022 - Mon
Raghavendra Hullur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Gary Demos

Thanks - worked perfectly the first time!
Gary Demos

How would I add the \$ sign?
SOLUTION
Raghavendra Hullur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Gary Demos

Thanks!
James0628

I know that you've already accepted a solution, and I'm not looking for any points, but I wanted to ask a few questions (to check for potential problems), and offer an alternative solution.

Do you only want to see decimal places on the millions?  For example, if you had 10,200, do you want to see 10K or 10.2K ?

Do you ever want to see more than one decimal place?  For example, if you had 1,230,000, do you want to see 1.2M or 1.23M?

Is rounding an issue?  For example, if you had something like 1,290,000 and only wanted one decimal place, do you want to see 1.2M or 1.3M?

If the value is less than 1,000, do you need to see any decimal places?

Assuming that you:
Only want a decimal place on the millions
Only want one decimal place
Don't need to round the decimals
Don't want any decimals on the values below 1,000

you could also handle it with a formula like the following:

``````if {your_field} >= 1000000 then
"\$" + CStr ({your_field} / 1000000, "#.#") + "M"
else
if {your_field} >= 1000 then
"\$" + CStr ({your_field} / 1000, "#") + "K"
else
"\$" + CStr ({your_field}, "#")
``````

Oh, I assumed that you also wanted to see the thousands below 10,000 as nK (1K, 2K, etc.).  If not, the formula could easily be changed.

James
Gary Demos