I would like to round values to the nearest 10 (0-4 = 0; 5-14 = 1; 15-24=2, etc.) I can get round to nearest 10, but I want to single digits for each range of numbers, as the example shows.
From -5 to 4 = 0, 5 to 14 = 1, 15 to 24 = 2 etc...
What I have tried...
int(math.ceil(x / 10.0)) * 10
This gives to nearest 10, but starts from 0 and gives to nearest 10 instead of single digit.
Any advice is helpful.
(x + 5) // 10? This assumes x is an integer.