Class: Parxer::Formatter::Number

Inherits:
Base
  • Object
show all
Defined in:
lib/parxer/formatters/number_formatter.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#apply, #initialize

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