Module: HumanNumber::Rails::Helpers
- Defined in:
- lib/human_number/rails/helpers.rb
Overview
Rails view helpers for human-readable number and currency formatting.
These helpers provide convenient access to HumanNumber functionality within Rails views and controllers with Rails-friendly parameter handling.
Instance Method Summary collapse
-
#currency(number, currency_code:, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting currency amounts with standard precision.
-
#human_currency(number, currency_code:, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting currency amounts with intelligent abbreviations.
-
#human_number(number, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting numbers with intelligent abbreviations.
Instance Method Details
#currency(number, currency_code:, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting currency amounts with standard precision.
37 38 39 |
# File 'lib/human_number/rails/helpers.rb', line 37 def currency(number, currency_code:, locale: I18n.locale, **) HumanNumber.currency(number, currency_code:, locale:, **) end |
#human_currency(number, currency_code:, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting currency amounts with intelligent abbreviations.
53 54 55 |
# File 'lib/human_number/rails/helpers.rb', line 53 def human_currency(number, currency_code:, locale: I18n.locale, **) HumanNumber.human_currency(number, currency_code:, locale:, **) end |
#human_number(number, locale: I18n.locale, **options) ⇒ Object
Rails helper for formatting numbers with intelligent abbreviations.
21 22 23 |
# File 'lib/human_number/rails/helpers.rb', line 21 def human_number(number, locale: I18n.locale, **) HumanNumber.human_number(number, locale:, **) end |