For example I have the following numbers:
30, 270, 530, 1110
but I want each to round up to:
40, 280, 540, 1120
Is that possible?
For example I have the following numbers:
30, 270, 530, 1110
but I want each to round up to:
40, 280, 540, 1120
Is that possible?
2
Answers
Just divide by 20, round and multiply by 20:
I think that the previous solution is wrong because 530 should be round to 520 instead of 540 because:
540 / 40 = 13.5
40 * 13 = 520
40 * 14 = 560
My code is longer but meet the previous requirements: