The NumberFormatter class provided by the Physical module, and used by Shipping, has this docblock:

/**
 * Default number formatter.
 *
 * Uses the intl NumberFormatter class, if the intl PHP extension is enabled.
 * Otherwise, returns the numbers as given.
 *
 * Commerce swaps out this class in order to use its own NumberFormatter which
 * does not depend on the intl extension.
 */

Which is great, except that I don't see Commerce doing the swap. Let's fix that.

Comments

bojanz created an issue. See original summary.

czigor’s picture

Status: Active » Needs review
StatusFileSize
new1.56 KB
bojanz’s picture

StatusFileSize
new3.16 KB

We need to default maximum_fraction_digits to 6, that's what Physical's NumberFormatterInterface promises.

Here's an updated patch.

  • bojanz committed e49ccdc on 8.x-2.x authored by czigor
    Issue #3011997 by bojanz, czigor: Commerce needs to swap out the...
bojanz’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.