Ruby Rounding to a Fraction (Precision)
Posted: Sat Nov 11, 2017 11:06 pm
Came across this while searching for something else and though I'd share it with you guys.
When doing float calculations in ruby we often get 16 decimal places in the result. This little patch will round to a specific fraction:
Very useful for drawing with pixel accuracy and also for knobs and sliders when you want to increment/decrement by a specific amount.
When doing float calculations in ruby we often get 16 decimal places in the result. This little patch will round to a specific fraction:
Very useful for drawing with pixel accuracy and also for knobs and sliders when you want to increment/decrement by a specific amount.