Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: incorrect formatter output with explicit MIN_FRACTION_DIGITS #12345

Closed
exru opened this issue Aug 26, 2016 · 4 comments
Closed

Bug: incorrect formatter output with explicit MIN_FRACTION_DIGITS #12345

exru opened this issue Aug 26, 2016 · 4 comments
Assignees
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug
Milestone

Comments

@exru
Copy link

exru commented Aug 26, 2016

'numberFormatterOptions'=>[
                NumberFormatter::MIN_FRACTION_DIGITS => 0,
                NumberFormatter::MAX_FRACTION_DIGITS => 0,
 ]

\Yii::$app->formatter->asCurrency($model->price, 'EUR');

//output 129 517,00 €
@SilverFire SilverFire added the status:to be verified Needs to be reproduced and validated. label Aug 26, 2016
@cebe
Copy link
Member

cebe commented Aug 29, 2016

@cebe cebe added this to the 2.0.11 milestone Aug 29, 2016
@cebe cebe added type:bug Bug status:ready for adoption Feel free to implement this issue. and removed status:to be verified Needs to be reproduced and validated. labels Aug 29, 2016
Oxyaction added a commit to Oxyaction/yii2 that referenced this issue Oct 1, 2016
cebe added a commit that referenced this issue Jan 2, 2017
@cebe cebe closed this as completed in 50f3012 Jan 2, 2017
@cebe
Copy link
Member

cebe commented Jan 2, 2017

Fixed, thanks for reporting! Also congrats to the nice issue number :)

@ptz-nerf
Copy link

Have same problem in 2.0.12(intl is 1.1). asCurrency() ignores numberFormatterOptions.
Code after https://github.com/yiisoft/yii2/blob/2.0.12/framework/i18n/Formatter.php#L1373 breaks formatting. If I delete it or place before "// set attributes" comment or delete options in Formatter config (such as decimalSeparator, thousandSeparator) all works fine.

@cebe
Copy link
Member

cebe commented Sep 22, 2017

@ptz-nerf please open a new issue and provide the code that produces the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready for adoption Feel free to implement this issue. type:bug Bug
Projects
None yet
Development

No branches or pull requests

5 participants