The NumberHelper class provides convenience methods for formatting numbers:
Turns a number into a currency representation. You can select the
:format (whether the currency comes before or
after the number), and
Turns file-size byte counts into more typical human representations, like 12 GB.
Turns a number into a percent value. You can select the
:precision (normally three digits after the decimal), and the
Turns a number into an American-style telephone number. You can specify a country code, extension, delimiter, and whether or not the area code has parentheses, but you can’t specify how the numbers are broken down.
Formats a number with a given
between thousands (
, by default) and decimal
Formats a number to present as many digits after the decimal point as are specified in the second argument (three is the default).