# Adding a decimal to a number

This topic is 6624 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hi All,

Quick question...how do I format or calculate a number field to add a \$ symbol plus a decimal to the number?

Example: number entered into the field 12345, when I tab out of the field I would like the number to show \$123.45

Update:

I found RussBaker's Handy Bits file and was able to get the \$ and decimal to display, but the number that displayed was \$12,345.00. Does anyone know how to get the number to display without the zeros? Just display the actual number \$123.45

thanks again, sheryl

##### Share on other sites

Divide by 100, and then set the number formatting to decimal, fixed places set to 2 and show the \$.

##### Share on other sites

Hi Thanks for responding,

below is the last line of the calculation he wrote. I'm am not versed in writting calculations or scripts(haven't learned the language)and don't understand any of it. But...I believe this last line contains the information you were referring to above. I have tried rewriting this line by changing the "Right" to "Left", removing the "00"&, changing the 100* to 10*, to 1* and still I can't get my number to show \$123.45.

"." & Right("00"&Round((100*(Abs(Total Sales Receipt) - Int(Abs(Total Sales Receipt)))),0),2)

The reason I am trying to perform this task is to cut down on data entry error. If the number 12345 can automatically translate to \$123.45, I would greatly appreciate it. This seems like it should be such an easy formatting function, but obviously it's not.

PS. Is there a book out there that I could pickup to learn how to write and speak this scripting/calculation language? I'm sure there must be some kind of FM Scripting for Dummies?

##### Share on other sites

Assuming you want a number and not a text result.

Case (PaternCount (Total Sales Receipt, ".") = 0, Total Sales Receipt / 100, Total Sales Receipt)

Format the number field in the layout mode to be decimal, fixed 2 places and show \$.

The calculation fragment you are showing looks like it is part of a text calculation.

This will be a new field.

##### Share on other sites

You, my friend are the BOMB!!!!

Below is the calculation used to achieve the following result:

number entered into "Total Sales Receipt" = 12345

number displayed in "Total Sales Receipt Calc" = \$123.45

Case(Total Sales Receipt<0,"-\$","\$") &

Case(PatternCount(Total Sales Receipt, ".") = 0, Total Sales Receipt / 100, Total Sales Receipt)

May the sun shine brightly on the rest of your days!

Thank you, Sheryl

##### Share on other sites

This topic is 6624 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account