Class: Parxer::Formatter::Number
- Defined in:
- lib/parxer/formatters/number_formatter.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Parxer::Formatter::Base
Instance Method Details
#format_value(v) ⇒ Object
4 5 6 7 8 |
# File 'lib/parxer/formatters/number_formatter.rb', line 4 def format_value(v) v = integer? ? v.to_i : v.to_f v = v.round(round) if round? v end |