Newbies PabloH Posted May 13, 2005 Newbies Posted May 13, 2005 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!
David Holmberg Posted May 13, 2005 Posted May 13, 2005 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....
comment Posted May 13, 2005 Posted May 13, 2005 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
Newbies PabloH Posted May 13, 2005 Author Newbies Posted May 13, 2005 Cool I'll try it.... Thanks Everyone!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now