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
[SR-12036] Incorrect and inconsistent NumberFormatter behavior for currencies on Linux #3277
Comments
On macOS for 5.1.2, this is behaving correctly: https://github.com/peek-travel/swift-currency/pull/7/checks?check_run_id=390462152 |
Is this failing on Linux or macOS or both? The ICU version on Linux was changed recently for `5.2` and `master` and that would probably causes issues. I also remember some of the scl-foundation tests being different between Linux and Catalina around currency. |
@spevans This only fails on Linux. macOS (Catalina) with 5.0.3, 5.1.2, and 5.2 snapshot all pass the unit tests correctly. |
Does the "regression" where we get the currency identifier, rather than the symbol, from Swift 5 -> 5.1 on Linux have a known reason why it happened? |
The underlying ICU library that does the currency formatting is tied to the OS version on macOS but the Swift version on Linux. Also the Linux version just compiles the default ICU source code, for macOS Apple make some small changes so its hard to compare Swift versions between Linux and macOS for this. As for the regression Im trying to work out whats changed. Its pretty much left to ICU to do the formattering work. Do you have a complete code segment that I can paste into the REPL to check the output? Hopefully I can then convert it into a unit test for scl-foundation |
@spevans I've attached a project with a failing unit test. |
The issue looks to be that when no #2614 should fix this |
@spevans Is it still possible to ship this in 5.2? If there's a 5.1.5, is it possible to fix this then as well? |
It should be ok for 5.1/5.2 as it is a clear bug fix so just need to make sure the backport PR is approved in time. The fix should be in the nightly snapshot swift-DEVELOPMENT-SNAPSHOT-2020-01-20-a, can you confirm it works for you then I will sort out the backport. |
@spevans I have pulled the latest trunk snapshot, and my unit tests are passing again! Thanks 🙂 |
Thanks for testing I will open a backport PR. |
Attachment: Download
Environment
Swift 5.1.2, 5.2 snapshots, and trunk snapshots
Additional Detail from JIRA
md5: bb12216218c8b4e98f1eb9e447dd583e
Issue Description:
The project in reference is Swift Currency. The unit tests that validate the string output from
NumberFormatter
is failing, but in different ways.The failing test case:
The relevant pieces of code:
On Swift 5.0.3 the formatter correctly returns:
14.928,79 £
On Swift 5.1.2:
14.928,79 GBP
On Swift 5.2 snapshot (as of Jan 14, 2019):
14.928,79 €
On the latest trunk (as of Jan 14, 2019):
14.928,79 €
The text was updated successfully, but these errors were encountered: