How do I round a fraction to the nearest 0.5 between 0.0 and 5.0?
Let's say I've got 11/150, it should convert to 0.0. In addition, 75/150 should convert to 2.5
As for the code I've got this but I'm lost as to where to go from here
# number is 11, and max is 150
number = float(percent / max)
number = round(p/0.5)*0.5
However, it needs to round between 0.0 and 5.0 rather than 0 and 1.
EDIT 1:
It's best to treat it as a percentage. For example, let's say the percent given is 5o% (50/100, for ease). This means the result should be 2.5
In the same respect, 51% would still be 2.5.
However, 60% (60/100) would be 3.0