Dynamic integer will be any number from 0 to 150.
i.e. – number returns 41, need to return 50. If number is 10 need to return 10. Number is 1 need to return 10.
Was thinking I could use the ceiling function if I modify the integer as a decimal…? then use ceiling function, and put back to decimal?
Only thing is would also have to know if the number is 1, 2 or 3 digits (i.e. – 7 vs 94 vs 136)
Is there a better way to achieve this?
Thank You,
How this works. The % operator evaluates to the remainder of the division (so
41 % 10evaluates to 1, while45 % 10evaluates to 5). Subtracting that from 10 evaluates to how much how much you need to reach the next multiple.The only issue is that this will turn 40 into 50. If you don’t want that, you would need to add a check to make sure it’s not already a multiple of 10.