Class: Float
Class Method Summary collapse
Class Method Details
.typecast(value) ⇒ Object
16 17 18 19 |
# File 'lib/presenter/types.rb', line 16 def self.typecast(value) value_to_f = value.to_f value_to_f == 0 && value.to_s !~ /^0*\.?0+/ ? nil : value_to_f end |