Module: L10n::Forms::FormBuilder
- Defined in:
- lib/l10n/forms.rb
Instance Method Summary collapse
Instance Method Details
#amount_field(field, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/l10n/forms.rb', line 5 def amount_field(field, = {}) = () = .extract!(:locale, :precision, :significant, :separator, :delimiter, :strip_insignificant_zeros) value = L10n.number_to_rounded(object.public_send(field), ) [:value] = value [:class] = "#{[:class]} amount_field" text_field(field, ) end |