Round floats to the nearest X
For those pesky times when whole numbers just won’t cut it, but you only want some precision.
The magic, courtesy of Daniel Morrison:
Note that do to some quirks with Ruby’s handling of floats, you won’t get what you expect in some situations:
This content is open source.
Suggest Improvements.