September 16, 200916 yr Hi Have searched for the answer but can't find. I have a number field that returns a decimal. I would like to round 1.5 and under to 1 and 1.6 and over to 2 etc. I think this should be easy but haven't found the ceiling, floor, round calcs or any combination to work. Thanks so much! Note: Using XP 8.5 Advanced (at work)
September 16, 200916 yr Author Hi I think I got it. Round ( Truncate ( Abs (zzDays since receiving - zzElapsedTimeSetUp)/30 ; 1 ) ;0 ) This has a few other things thrown in but basically it's Round ( Truncate ( NumberField ; 1 ) ;0 ) Thanks for the mind field!
September 16, 200916 yr Hi try: Let([ n = YourNumberField ; d = Length ( Mod ( n ; 1 ) ) ]; Round ( n - 10 ^ - d * Sign ( n ) ; 0 ) )
September 16, 200916 yr Author Comment / Lee You're both absolutely right! (Especially Comment lol) I didn't quite understand the the "precision" part of the calc when using 0. : Thanks for your time.
September 17, 200916 yr doesn' this do the same thing? Round ( YourNumber ; 0 ) no... Round ( 1.5 ; 0 ) returns 2 and not 1 as asked. P.S.: it wasn't asked but my calc also reverts the rounding for negative numbers, so that -1.5 rounds up to -1
Create an account or sign in to comment