Change record status: 
Project: 
Introduced in branch: 
8.x-2.x
Introduced in version: 
8.x-2.7
Description: 

Due to changes in the commerceguys/intl library (v1.0.0), a number of changes have been made to the number/currency formatting API.

1) PriceEvents::NUMBER_FORMAT_LOAD (commerce_price.number_format.load) is deprecated and no longer fired.
Subscribe to PriceEvents::NUMBER_FORMAT (commerce_price.number_format) instead, which receives the new NumberFormatDefinitionEvent.
NumberFormatDefinitionEvent receives a definition array, instead of a NumberFormat object, which is no longer mutable.

2) The commerce_price.number_formatter_factory service is deprecated.
Instead, inject commerce_price.number_formatter to format numbers, or commerce_price.currency_formatter to format currency amounts (prices).

Examples:

$number_formatter = \Drupal::service('commerce_price.number_formatter');
echo $number_formatter->format('1234.99'); // 123,456.99
echo $number_formatter->format('0.75', ['style' => 'percent']); // 75%

$currency_formatter = \Drupal::service('commerce_price.currency_formatter');
echo $currency_formatter->format('2.99', 'USD'); // $2.99
// The accounting style shows negative numbers differently and is used
// primarily for amounts shown on invoices.
echo $currency_formatter->format('-2.99', 'USD', ['style' => 'accounting']); // (2.99$)

For a full list of available options, see the NumberFormatterInterface and CurrencyFormatterInterface.

Impacts: 
Module developers