I got a change request from a customer to make sure that the prices in the cart overview were maximum 2 digits.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

borisson_ created an issue. See original summary.

borisson_’s picture

Status: Active » Needs review
Issue tags: +Needs tests
FileSize
2.57 KB

This resolved my ticket internally, hopefully this can help others as well. This needs tests as it currently doesn't have any.

borisson_’s picture

FileSize
1.02 KB

Actually that didn't work for the views footer area. Attached patch does.

borisson_’s picture

FileSize
861 bytes
1.1 KB
ayalon’s picture

Status: Needs review » Reviewed & tested by the community

Thank you for that patch. This was exactly what I needed for the Swiss CHF Currency aswell.

Tested and it works well in all related views.

borisson_’s picture

Title: Expose 'maximum fraction digits' from the price formatter » Use 'maximum fraction digits' from the price formatter in the views handlers
Status: Reviewed & tested by the community » Needs work

Patch in #4 doesn't do what the title said.

Also setting back to needs work for test-coverage.

borisson_’s picture

FileSize
1009 bytes

Needed a reroll for the RC.

edurenye’s picture

Status: Needs work » Closed (outdated)

Now this is done in 'intl/src/Formatter/CurrencyFormatter.php'
So, we can close the issue.