I feel like I'm missing something really simple here, but the round function is not working as I'm expecting. I am wanting to divide a number (vehicle mileage) by 1000 and round it to the nearest 5 and then adding 5. I'm using this function:
ROUND([Mileage at Last Service Date]/5000)*5+5
When I test it, this is one of the results:
159880/5000 = 31.976 so I was expecting it to round to 32, not 31. Does this function not follow rounding based on being under or above .5 ?
Solved! Go to Solution.
Please try an expression of
ROUND([Mileage at Last Service Date]/5000.000)*5+5
For decimal division, AppSheet expects numerator or divisor to be in decimals.
Make sure you take care of Number vs Decimal types correctly.
Number/Number gives in effect a FLOOR result. (i.e 5/2 gives you 2)
Thank you! I knew I was missing something simple like this.
Please try an expression of
ROUND([Mileage at Last Service Date]/5000.000)*5+5
For decimal division, AppSheet expects numerator or divisor to be in decimals.
That worked perfectly. Thank you
User | Count |
---|---|
15 | |
15 | |
8 | |
7 | |
4 |