Class: ParamsReady::Value::DecimalCoder
- Inherits:
-
Coder
- Object
- Coder
- ParamsReady::Value::DecimalCoder
show all
- Defined in:
- lib/params_ready/value/coder.rb
Class Method Summary
collapse
Methods inherited from Coder
value_class_name
#class_reader_writer
Methods included from Coercion
#strict_default?, #try_coerce
Class Method Details
.coerce(input, _) ⇒ Object
88
89
90
91
|
# File 'lib/params_ready/value/coder.rb', line 88
def self.coerce(input, _)
return nil if input.nil? || input == ''
BigDecimal(input)
end
|
93
94
95
|
# File 'lib/params_ready/value/coder.rb', line 93
def self.format(value, format)
value.to_s('F')
end
|