# Rounding a Number Up

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

## Recommended Posts

• Newbies

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!

##### Share on other sites

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 )

)

##### Share on other sites

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

##### Share on other sites

• Newbies

Cool I'll try it.... Thanks Everyone!

##### Share on other sites

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

## Create an account

Register a new account