I have an animation timeline of sorts that has a resolution set which is a factor of 1 second.
A resolution of 4 is (1000/4) which means that events are called every .25 .5 and .75th of a second.
I need a way to round the decimals of floats that the user enters to the set resolution so that my timeline events can only start and end on numbers from the resolution.
With a resolution of 4, 1.20 would round up to 1.25, 4.85 would be rounded down to 4.75, and 2.5 wouldn't be rounded
What is the simplest way to do this using the given the float in question and the resolution?