This modules provides methods to translate numbers in specific formats, such as percentage, phone numbers, rounding, etc.
More...
This modules provides methods to translate numbers in specific formats, such as percentage, phone numbers, rounding, etc.
◆ number_to_percentage()
NumberHelper::number_to_percentage |
( |
|
$number, |
|
|
|
$options = array() |
|
) |
| |
Translates numbers to percantage.
- Parameters
-
integer | $number | The number to be converted in percentage |
array | $options | (optional) Accepts the options expressed in the $DEFAULT_CURRENCY_VALUES property of NumberHelper, whom will be overwritten. |
◆ number_to_phone()
NumberHelper::number_to_phone |
( |
|
$number, |
|
|
|
$options = array() |
|
) |
| |
Translates numbers to phone numbers.
- Parameters
-
integer | $number | Returns a telephone number formatted number |
array | $options | (optional) Associative array. Accepts keys: 'area_code', 'delimiter', 'extension', 'country_code' |
◆ number_with_delimiter()
NumberHelper::number_with_delimiter |
( |
|
$number, |
|
|
|
$options = array() |
|
) |
| |
Formats numbers with given delimiter.
- Parameters
-
integer | $number | The number to be formatted |
array | $options | (optional) Associative array. Accepts keys: 'delimiter', 'separator' |
◆ number_with_precision()
NumberHelper::number_with_precision |
( |
|
$number, |
|
|
|
$options = array() |
|
) |
| |
Rounds number to the given decimal precision.
- Parameters
-
integer | $number | The number to be rounded |
array | $options | (optional) Associative array. Accepts keys: 'precision', 'significant', 'strip_significant_zeros', 'separator' |