Skip to content

[SR-13952] Nil value from Number Formatter #3963

Open
@swift-ci

Description

@swift-ci
Previous ID SR-13952
Radar rdar://problem/72183860
Original Reporter dimitri.strauneanu (JIRA User)
Type Bug
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
Votes 1
Component/s Foundation
Labels Bug, ICU, Linux
Assignee None
Priority Medium

md5: e9e8d7e301b891b7980c160325f3757c

Issue Description:

Running the following code gives different results for MacOS and Ubuntu 16.04.

let identifier = "en_RO"
let price = "99,55"

let formatter = NumberFormatter()
formatter.locale = Locale(identifier: identifier)
formatter.numberStyle = .decimal
formatter.maximumFractionDigits = 2

print(String(describing: formatter.number(from: price)))

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)

Ubuntu 16.04 with Swift version:
Swift version 5.3.1 (swift-5.3.1-RELEASE)
Target: x86_64-unknown-linux-gnu
Output: {code:swift}nil

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions