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-13952] Nil value from Number Formatter #3963
Comments
@swift-ci create |
Comment by Dimitri Strauneanu (JIRA) Any updates here? Is there any possible workaround for now? This is a real blocker. |
Confirmed this discrepancy also appears between Xcode 12.3 and the latest 5.3 Focal image: $ swift
Welcome to Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28).
Type :help for assistance.
1> import Foundation
2> let identifier = "en_RO"
3. let price = "99,55"
4.
5. let formatter = NumberFormatter()
6. formatter.locale = Locale(identifier: identifier)
7. formatter.numberStyle = .decimal
8. formatter.maximumFractionDigits = 2
9.
10. print(String(describing: formatter.number(from: price)))
Optional(99.55)
11> ^D
$ docker run -ti --rm --privileged swift:5.3-focal
root@e25849567a2d:/# swift
Welcome to Swift version 5.3.1 (swift-5.3.1-RELEASE).
Type :help for assistance.
1> import Foundation
2> let identifier = "en_RO"
3. let price = "99,55"
4.
5. let formatter = NumberFormatter()
6. formatter.locale = Locale(identifier: identifier)
7. formatter.numberStyle = .decimal
8. formatter.maximumFractionDigits = 2
9.
10. print(String(describing: formatter.number(from: price)))
nil |
Based on the results of querying the |
It looks to be an ICU issue on Linux. The |
Environment
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
Swift version 5.3.1 (swift-5.3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional Detail from JIRA
md5: e9e8d7e301b891b7980c160325f3757c
Issue Description:
Running the following code gives different results for MacOS and Ubuntu 16.04.
MacOS with Swift version:
Apple Swift version 5.2.4 (swiftlang-1103.0.32.9 clang-1103.0.32.53)
Target: x86_64-apple-darwin19.6.0
Output: {code:swift}Optional(99.55)
The text was updated successfully, but these errors were encountered: