Sketchup ruby round number

Unless you need to support versions of SketchUp prior to SU 2014, you can just use the revised version of Float#round introduced in Ruby 1.9. It takes an argument specifying the number of decimal places to retain:

3.14159265.round(0) => 3
3.6.round(0) => 4
1 Like