Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

  • Newbies
Posted

Hello everyone,

I'm kind of new to Filemaker Pro. I'm trying for filemaker to round a number up. For example.. I have a calculation that I want the result to be the nearest multiple of 10. For example if it's 84 then I would want my result to be 90.. I'm not sure if this is even possible but any help would be appreciated. Thank You!

Posted

This is not the prettiest solution but I think it works (havn't tried it though) . Don't remember if the "Let-function" is in FMP 6 but otherwise you can just put Ceiling(yourfield) and Right(Ceiling(yourfield)) directly in the calc

Let(

[

nm1=Ceiling(yourfield);

nm2=Right(nm1;1)

];

nm1 + Case(nm2 "not equal to" 0; 10-nm1;0 )

)

...couldn't get the not equal to sign into this post....

Posted

IIRC, there is no Ceiling() function in version 6. Try:

n + Choose ( 1 + Sign ( Mod ( n , 10 ) ) , Mod ( n , 10 ) , 0 , 10 - Mod ( n , 10 ) )

This works in a fashion similar to Ceiling - always rounds up, i.e. in the direction of positive infinite.

If you don't expect negative numbers, you can simplify to:

( Int ( n / 10 ) + not not Mod ( n / 10 ; 1 ) ) * 10

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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