Class: Kiss::Format::Decimal

Inherits:
Integer show all
Defined in:
lib/kiss/format.rb

Class Method Summary collapse

Methods inherited from Integer

validate

Methods inherited from Kiss::Format

inherited, lookup, validate

Class Method Details

.parse(value, context = {}) ⇒ Object



79
80
81
# File 'lib/kiss/format.rb', line 79

def parse(value, context = {})
  value.to_f
end

.value_to_s(value, context = {}) ⇒ Object



83
84
85
86
# File 'lib/kiss/format.rb', line 83

def value_to_s(value, context = {})
  # add commas for thousands, to integer part only
  value.format_thousands
end