The Intl class provides helper functions for internationalization, eg. timezones, currencies etc.
The specification of floats is here.
Timezones
Intl::toUTC()
Intl:: fromUTC()
Intl::toCPH()
Intl:: fromCPH()
Units
Intl::unit()
Intl::fromMetric()
Intl::toMetric()
Money and numbers
Format a number as a currency/amount of money.
params
$pences | int | Money amount in pences/ører/whatever |
result
string | The amount as a string, typically with 2 decimals, eg. “45,20” |
Intl::parseCurrency()
Intl::validateCurrency()
Convert a float to a string, with decimals if necessary.
params
result
string | The value formatted as a string |
Intl::parseFloat()
Intl::parseNumber()
Intl::thousand_separator()
Get/set the thousand separator.
params
$sep | mixed | New thousand separator; if not set then use the default thousand separator |
result
mixed | the current thousand separator |