Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(currencyFilter): Remove hardcoded fractionSize in currency #7539

Closed
wants to merge 1 commit into from

Conversation

clark-pan
Copy link
Contributor

Request Type: bug

How to reproduce: _

  • In a config block, update the minFrac and maxFrac values in $locale for the currency pattern
  • Run a value through the currency filter

Expected behaviour:

The string outputted follows the pattern rules set in $locale

Actual behaviour:

The minFrac and maxFrac properties are ignored

Component(s): misc core

Impact: small

Complexity: small

This issue is related to:

Detailed Description:

The hardcoded fractionSize in the currencyFilter makes the minFrac and maxFrac options in $locale redundant.

The default minFrac and maxFrac options in $locale are functionally equivalent and removing the hardcoded value would allow the behaviour of the currencyFilter to be customisable.

Other Comments:

The motivation behind this change is to make i18n of currencies slightly easier.

Currencies such as the Yen typically are rendered with no decimal places, and the Dinar is usually rendered with 3 decimal places. Please refer to http://en.wikipedia.org/wiki/ISO_4217#cite_note-ReferenceA-6 for a full list of currencies and their decimal places.

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7539)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

The hardcoded fractionSize in the `currencyFilter` makes the minFrac and maxFrac options in $locale redundant.
The default minFrac and maxFrac options in $locale are functionally equivalent.
@clark-pan
Copy link
Contributor Author

Signed CLA, and updated the commit email. ping @mary-poppins

@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

@clark-pan clark-pan added cla: yes and removed cla: no labels Jul 7, 2014
@petebacondarwin
Copy link
Contributor

Duplicte of #5672

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants