Class: Laser::Cutter::UnitsConverter
- Inherits:
-
Object
- Object
- Laser::Cutter::UnitsConverter
- Defined in:
- lib/laser/cutter/units_converter.rb
Overview
Converts lengths between millimetres and inches, rounded to five digits.
Class Method Summary collapse
-
.in2mm(value) ⇒ Float
The same length in millimetres.
-
.mm2in(value) ⇒ Float
The same length in inches.
Class Method Details
.in2mm(value) ⇒ Float
Returns the same length in millimetres.
15 16 17 |
# File 'lib/laser/cutter/units_converter.rb', line 15 def self.in2mm(value) (25.4 * value).round(5) end |
.mm2in(value) ⇒ Float
Returns the same length in inches.
9 10 11 |
# File 'lib/laser/cutter/units_converter.rb', line 9 def self.mm2in(value) (0.039370079 * value).round(5) end |