0001 Round_half

Rounding in Ruby doesn't work like it does in Python, but you can customize it to change that behavior

0001-round_half_1.png

By default it will be in :up mode and return the value furthest from 0. In :down mode it will do the opposite and in :even mode it will return the nearest even number, for statistical fairness (as in python)

0001-round_half_2.png

Link to Ruby documentation for Float#round