Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Adding a decimal to a number

Featured Replies

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

Thanks in advance, Sheryl smile.gif

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

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

  • Author

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?

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.

  • Author

You, my friend are the BOMB!!!!!!!!!! grin.gif

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

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.