Does anyone know how I would go about rounding a float to the nearest 0.5 (for example 10.4 would become 10.5, and 32.6 would become 32.5, and 101.9 would become 102 etc). I understand how to round floats / convert them into whole integers but cannot find a solution to rounding to the nearest 0.5 float.

Any help will be greatly appreciated!