I have two inputs
min, max
In the case where min=32 and max=46 then I would like PHP to automatically the value to the nearest 5/10 i.e. in this case min=30 and max=50?
But in the instance of course if min=35 or 40 and max=40 or 45 there would be no need to round off.
How do achieve this in PHP?
Btw the system only deals with integer values and the above values are just examples. It needs to work for a range of numbers ranging from 0 to infinity. So 4 would round to 0, 6 to 10… etc…
1 Answer