Module: Formatting::Percent
- Included in:
- Formatting
- Defined in:
- lib/formatting/percent.rb
Instance Method Summary collapse
Instance Method Details
#format_percent(number, opts = {}) ⇒ Object
5 6 7 8 9 |
# File 'lib/formatting/percent.rb', line 5 def format_percent(number, opts = {}) format_string = opts.fetch(:format) { default_percent_format_string } formatted_number = Formatting.format_number(number, opts) format_string.gsub("<number>", formatted_number) end |