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.

Featured Replies

Hi all

Does anyone know how to round a figure up or down to for example 2 decimal places. I understand the function: Round (number, precision)but what I need is to be able to round a figure like 1.2876 down to 1.28

I hope that makes sense to someone.

Many thanks

Hi "Transit"

This will do it.

Round(Number/ .02,0)*.02

HTH

Lee

Hi Transit,

In the example you've given 1.2876, you aren't rounding at all but rather truncating to two-digit decimal. If you want to drop everything past the second decimal, try instead:

Truncate (number, precision) or Truncate(YourNumberField), 2)

This will always leave you with two decimal points. You can include Round in the calculation also if you wish which would give you 1.29 or if the number was 1.2538 would give you 1.25. You can also just leave it as it is and use field format to display only two decimal points. smile.gif

LaRetta

  • Author

Thanks Lee

A simple solution!

I like them

Many thanks

  • Author

Thanks LaRetta

It would seem from what you are saying that truncate is for rounding down and round can be used for rounding up or down.

I have never used truncate before so thankyou for introducing me to that!

The reason I didnt use field format to display only two decimal points was that I was using this field to make further calculations and so needed the rounding down at this point and from what I can gather although it may only display two decimal points it calculates on the full "unrounded" figure, or have I missed somethink?

Many thanks

Okay, now I'm curious: I get rounding off and rounding down, but how do you round up? Just round down and add one?

Round(Number, 2)

cool.gif

Truncating isn't really rounding. It's chopping off additional digits after the specified number of decimal places and ignoring them. So it really has nothing in common with rounding. It does, however, seem to be the type of function for which you meant to ask wink.gif and LaRetta did a good job discerning that.

Do you mean consistently round up, regardless of the trailing digits? So, 1.27 and 1.21 would both round to 1.3 (instead of 1.3 and 1.2, respectively)? If so, then I would use Truncate( number, X ) + 1/10^X, where X is your number of precision.

Transit said...

what I need is to be able to round a figure like 1.2876 down to 1.28 (and) and so needed the rounding down at this point and from what I can gather although it may only display two decimal points it calculates on the full "unrounded" figure

Truncate removes the '76' and that 2-decimal figure can't be rounded any lower than 1.28. smile.gif If you only want to round down, Truncate will do the trick nicely. It will only calculate through the second decimal if you specify the precision of 2.

And Round goes both ways, Scott. smile.gif 1.255 becomes 1.26 and 1.254 becomes 1.25. Truncate would make them both 1.25 because it drops past the second decimal - no rounding.

FM provides many wonderful number functions (did I say that Queue?) which will allow fine-tuning of your numbers ... it just depends upon what you want. smile.gif

LaRetta

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.