-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(currencyFilter): trim currency string #15085
fix(currencyFilter): trim currency string #15085
Conversation
Trim any beginning or trailing white space in a currency string. Motivation: global fix for issue 15018
Trim currency string
trim currency string
Does anybody know how I would change locale for an automated test? |
You mean in a unit test? |
Yes On Sep 5, 2016 3:03 PM, "Martin Staffa" notifications@github.com wrote:
|
add some unit tests
Why did you remove the fix from the commit? |
@Narretz The fix is still there. I was just trying things to get a unit test. Check the "files changed" tab. |
Ah I see, sorry. The test code you changed is a docs end 2 end test, not a unit test though. The filter spec files are in the test folder. |
add actual unit test, remove e2e test
@Narretz Thanks! Got the unit test in. |
This does not fix #15018. In fact it just fixes certain cases (i.e. locales which put the currency symbol after the number), but is not a generic fix (see #15018 (comment) for more details). I am tempted to merge this even if it fixes only some of the cases (as a proper fix is quite more involved), but that would be "unfair" to certain locales :/ |
@gkalpak Would appending a I'll try to add some unit tests and fix based off those when I get home. |
No, I don't think it would work for all cases (although it would take care of several more than the current implementation). Take into account that people might be overwriting the locals I have a more general fix. I will submit a PR. |
In most locales, this won't make a difference (since they do not have whotespace around their currency symbols). In locales where there is a whitespace separating the currency symbol from the number, it makes sense to also remove such whitespace if the user specified an empty currency symbol (indicating they just want the number). Fixes angular#15018 Closes angular#15085
In most locales, this won't make a difference (since they do not have whotespace around their currency symbols). In locales where there is a whitespace separating the currency symbol from the number, it makes sense to also remove such whitespace if the user specified an empty currency symbol (indicating they just want the number). Fixes angular#15018 Closes angular#15085
In most locales, this won't make a difference (since they do not have whitespace around their currency symbols). In locales where there is a whitespace separating the currency symbol from the number, it makes sense to also remove such whitespace if the user specified an empty currency symbol (indicating they just want the number). Fixes #15018 Closes #15085 Closes #15105
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Bug fix
What is the current behavior? (You can also link to an open issue here)
For certain locales, when the
currencySymbol
is set to an empty string, there is trailing white space. See issue #15018What is the new behavior (if this is a feature change)?
Any currency string will be trimmed.
Does this PR introduce a breaking change?
yes
Please check if the PR fulfills these requirements
Other information:
Trim any beginning or trailing white space in a currency string.
Motivation: global fix for issue 15018