Method: Unitwise::Number.coefficify
- Defined in:
- lib/unitwise/number.rb
.coefficify(value) ⇒ Integer, BigDecimal
Coerces a string-like number to a BigDecimal or Integer as appropriate
40 41 42 43 44 45 46 47 |
# File 'lib/unitwise/number.rb', line 40 def self.coefficify(value) d = BigDecimal(value.to_s) if (i = d.to_i) == d i else d end end |