Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Ruby Rounding to a Fraction (Precision)

Post any examples or modules that you want to share here

Ruby Rounding to a Fraction (Precision)

Postby DaveyBoy » 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:

Image

Precision.fsm
(384 Bytes) Downloaded 1169 times


Very useful for drawing with pixel accuracy and also for knobs and sliders when you want to increment/decrement by a specific amount.
User avatar
DaveyBoy
 
Posts: 131
Joined: Wed May 11, 2016 9:18 pm
Location: Leeds UK

Return to User Examples

Who is online

Users browsing this forum: No registered users and 8 guests

cron