Document toolboxDocument toolbox

Intl

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

Intl::formatCurrency()

Format a number as a currency/amount of money.

params
$pencesintMoney amount in pences/ører/whatever
result
stringThe amount as a string, typically with 2 decimals, eg. “45,20”


Intl::unformatCurrency()

Intl::parseCurrency()

Intl::validateCurrency()

Intl::formatFloat()

Convert a float to a string, with decimals if necessary.

params
$valfloatA value
result
stringThe value formatted as a string


Intl::parseFloat()

Intl::parseNumber()

Intl::thousand_separator()

Get/set the thousand separator.

params
$sepmixedNew thousand separator; if not set then use the default thousand separator
result
mixedthe current thousand separator