class NumbTo::Format

Constants

HELPER

Public Instance Methods

human_number(number, **options) click to toggle source

Format Number

# File lib/numb_to/format.rb, line 37
def human_number(number, **options)
  HELPER.number_to_human(number, options)
end
inr(number, **options) click to toggle source
# File lib/numb_to/format.rb, line 12
def inr(number, **options)
  options.delete!(:unit) if options.any?
  HELPER.number_to_currency(number, options.merge!(unit: 'Rs. '))
end
percentage(number, **options) click to toggle source

Format Percentage

# File lib/numb_to/format.rb, line 19
def percentage(number, **options)
  HELPER.number_to_percentage(number, options)
end
phone(number, **options) click to toggle source

Format Phone Number

# File lib/numb_to/format.rb, line 25
def phone(number, **options)
  HELPER.number_to_phone(number, options)
end
size(number, **options) click to toggle source

Format Size

# File lib/numb_to/format.rb, line 31
def size(number, **options)
  HELPER.number_to_human_size(number, options)
end
usd(number, **options) click to toggle source

Format Money

# File lib/numb_to/format.rb, line 7
def usd(number, **options)
  options.delete(:unit) if options.any?
  HELPER.number_to_currency(number, options)
end