Repository navigation
0.15.0
💥 Breaking changes
- The constructors of these exception classes are now
@internal:ExchangeRateProviderExceptionMoneyFormatException
MoneyNumberFormatterhas been removed; callNumberFormatter::formatCurrency()directly insteadMoney::formatToLocale()andMoneyLocaleFormatter:- now format through ICU's modern number skeleton pipeline, and minor formatting differences may appear in some locales
- now require the intl extension to be linked against ICU 62.1 or later, and throw a
MoneyFormatExceptionon older ICU (this is independent of the PHP version) - now accept a
CurrencyDisplayparameter in the second position - now throw a
MoneyFormatExceptionif the amount cannot be accurately represented as a float, rather than formatting it with wrong digits - now throw a
MoneyFormatExceptionif the intl extension has no data for the locale's language (e.g.xx_YY), rather than silently formatting in the process default locale
- The
$allowWholeNumberparameter ofMoney::formatToLocale()andMoneyLocaleFormatterhas been renamed to$hideFractionIfWhole
✨ New features
Money::formatToLocale()andMoneyLocaleFormatternow accept aCurrencyDisplayparameter controlling how the currency is displayed:Symbol(default),NarrowSymbol,Code,Name, orNone(amount only)MoneyLocaleFormatternow properly displays custom currencies whose code is not three letters (e.g.USDT,GOLD)