Skip 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.

Round Money to Two Decimal

Featured Replies

How can fix the below calculation to round the result to a two decimal number?

For example: 02:00:00 x $80.20 = $160.40, NOT $160.412457457

(I know the numbers are not accurate, just for sake of example)

My current calculation:

n_rate_hourly * (Hour(t_time) + (Minute(t_time)/60)

Thank you for your help!

Try:

Round ( rate * time / 3600 ; 2 )

You really need result 160.40? Not 160.41? - a I see on example.

What in this case - 160.46 also need to be 160.40?

Rate calculations are very different and not always use "Round".

Sometimes also function Truncate is used.

Most commonly changing the settings on the layout for the number display is the way to go. I presume you actually need the number rounded to the nearest penny and the dollar sign added so that you can display the info in a UI element such as a dialog or export the value already formatted.

In that case you need to handle adding a trailing zero so that your answer is $160.40 instead of 160.4.

Handling a dollar sign and potentially a negative sign is also needed when formatting it as text.

For a numeric field called "Amount", the following may be the solution you seek.

To get this behavior:

160.08256 --> $160.08

160.1 --> $160.10

-160.05665 --> -$160.06

.205 --> $0.21

Use this function:

Case(

Amount < 0; "-";

""

)

&

Let (

[

amt = Round ( Abs(Amount) ; 2 );

dollars = Int(amt);

cents = 100 * (amt - dollars)

];

"$" & dollars & SerialIncrement ( ".00" ; cents )

)

  • 4 weeks later...
  • Author

Awesome, thank you all for your help!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.