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

fix($locale): Allow currency filter to fall back to maxFrac from locale #10179

Closed

Conversation

wesleycho
Copy link
Contributor

  • Modify default fallback to NUMBER_FORMATS.PATTERNS[1].maxFrac

Note that the default value currently is 2, so it preserves the existing behavior.

@googlebot
Copy link

CLAs look good, thanks!

@IgorMinar IgorMinar added this to the ng-fixit #1 milestone Nov 22, 2014
@@ -120,6 +120,14 @@ describe('filters', function() {
expect(currency(0.008)).toBe('$0.01');
expect(currency(0.003)).toBe('$0.00');
});

it('should set the default fraction size to the max fraction size of the locale value', inject(function($locale) {
$locale.NUMBER_FORMATS.PATTERNS[1].maxFrac = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you either use jasmine's mocking library or create a $locale mock for this test instead of trying to reset the value at the end of the test?

reason: if the expectations fail the state won't be restored and that will make all the subsequent tests fail and it will be hard to find the cause.

@IgorMinar
Copy link
Contributor

let's reclasify this to a fix. I think there is an open issue or maybe even prs for this, but they were all incorrect, so if you could find the dupes that would be awesome

@IgorMinar IgorMinar self-assigned this Nov 22, 2014
- Modify default fallback to `NUMBER_FORMATS.PATTERNS[1].maxFrac`

- Remove unnecessary resetting
@wesleycho wesleycho force-pushed the feat/locale_fraction_size branch from 550f64c to ec09be6 Compare November 22, 2014 19:06
@wesleycho wesleycho changed the title feat($locale): Allow currency filter to fall back to maxFrac from locale fix($locale): Allow currency filter to fall back to maxFrac from locale Nov 22, 2014
@wesleycho
Copy link
Contributor Author

Implemented fix. This does not look like it addresses any other open issues that I can find.

@IgorMinar IgorMinar closed this in 6dbd606 Nov 22, 2014
gkalpak pushed a commit to gkalpak/angular.js that referenced this pull request Dec 5, 2014
- Modify default fallback to `NUMBER_FORMATS.PATTERNS[1].maxFrac`

- Remove unnecessary resetting

Closes angular#10179
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