240 / 10 = 23,9999

You could use floor.

Just curious, why are you counting at 0.1 and then times by 10?