Page 1 of 1

Ruby Rounding to a Fraction (Precision)

PostPosted: Sat Nov 11, 2017 11:06 pm
by DaveyBoy
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:

Image

Precision.fsm
(384 Bytes) Downloaded 1182 times


Very useful for drawing with pixel accuracy and also for knobs and sliders when you want to increment/decrement by a specific amount.