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

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)

Link to Ruby documentation for Float#round