I need to round a number up to the nearest .25.
1.234532 = 1.25
1.5432 = 1.5
But the other example gives a wrong result:
Ceiling ( 1.5432 * 4) / 4 -> 1.75
Better use round():
Round ( 1.5432 *4; 0) / 4 -> 1.5
This should do:
Ceiling ( 1.234532 * 4 ) / 4 = 1.25
Thanks, never used the ceiling function.
The OP said "I need to round a number up"... but then contradicted themself with an example that rounds down... now you have both answers!
Yes, one should always read the whole thing carefully.
Rounding up not always means rounding up;-)
Here is this custom function I made:
SuperCeiling ( Number , RoundTo ) =
//This custom function rounds up a number to the closest RoundTo
Let ( [ Num = Number / RoundTo ;
Integ = Int ( Num ) ;
Frac = Num - Integ ] ;
( Integ + Ceiling ( Frac ) ) * RoundTo )
Retrieving data ...