cakephp/cakephp

No way how to change rounding strategy in NumberHelper

Harfusha opened this issue · 5 comments

Description

When i use locale cs_CZ NumberFormatter::ROUNDING_MODE defaults to NumberFormatter::ROUND_HALFEVEN, but i need to change it to NumberFormatter::ROUND_HALFUP.

Would be great if rounding strategy could be set in options.
$this->Number->format($decimalNumber, ['locale' => 'cs_CZ', 'places' => 2, 'precision' => 2, 'roundingMode' => NumberFormatter::ROUND_HALFUP])

CakePHP Version

4.5.2

Do you want to make a PR here for 5.x and we see how we can backport this?

Created PR for this
#17548

Well, usually we create 5.x first then backport
So nothing gets missing and we dont lose functionality in upstream

Ok i will create new one for 5.x :)

Here is the PR for 5.x #17552