encode_with

encode_with(coder) Instance Public methods

number_to_rounded

number_to_rounded(number, options = {}) Instance Public methods Formats a number with the specified level of :precision (e.g., 112.32 has a precision of 2 if :significant is false, and 5 if :significant is true). You can customize the format in the options hash. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :precision - Sets the precision of the number (defaults to 3). :significant - If true, precision will be the # of significant_di

number_to_phone

number_to_phone(number, options = {}) Instance Public methods Formats a number into a US phone number (e.g., (555) 123-9876). You can customize the format in the options hash. Options :area_code - Adds parentheses around the area code. :delimiter - Specifies the delimiter to use (defaults to â-â). :extension - Specifies an extension to add to the end of the generated number. :country_code - Sets the country code for the phone number. Examples number_to_phone(5551234)

number_to_percentage

number_to_percentage(number, options = {}) Instance Public methods Formats a number as a percentage string (e.g., 65%). You can customize the format in the options hash. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :precision - Sets the precision of the number (defaults to 3). :significant - If true, precision will be the # of significant_digits. If false, the # of fractional digits (defaults to false). :separator - Sets the separ

number_to_human_size

number_to_human_size(number, options = {}) Instance Public methods Formats the bytes in number into a more understandable representation (e.g., giving it 1500 yields 1.5 KB). This method is useful for reporting file sizes to users. You can customize the format in the options hash. See number_to_human if you want to pretty-print a generic number. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :precision - Sets the precision of the number

number_to_human

number_to_human(number, options = {}) Instance Public methods Pretty prints (formats and approximates) a number in a way it is more readable by humans (eg.: 1200000000 becomes â1.2 Billionâ). This is useful for numbers that can get very large (and too hard to read). See number_to_human_size if you want to print a file size. You can also define your own unit-quantifier names if you want to use other decimal units (eg.: 1500 becomes â1.5 kilometersâ, 0.150 becomes â150 millilitersâ,

number_to_delimited

number_to_delimited(number, options = {}) Instance Public methods Formats a number with grouped thousands using delimiter (e.g., 12,324). You can customize the format in the options hash. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :delimiter - Sets the thousands delimiter (defaults to â,â). :separator - Sets the separator between the fractional and integer digits (defaults to â.â). Examples number_to_delimited(12345678)

number_to_currency

number_to_currency(number, options = {}) Instance Public methods Formats a number into a currency string (e.g., $13.65). You can customize the format in the options hash. Options :locale - Sets the locale to be used for formatting (defaults to current locale). :precision - Sets the level of precision (defaults to 2). :unit - Sets the denomination of the currency (defaults to â$â). :separator - Sets the separator between the units (defaults to â.â). :delimiter - Sets the th

unsubscribe

unsubscribe(args) Class Public methods

subscribed

subscribed(callback, *args, &block) Class Public methods