Skip to content

[SR-15623] NumberFormatter behaves differently between macOS and Linux #3186

Open
@swift-ci

Description

@swift-ci
Previous ID SR-15623
Radar None
Original Reporter mgarfinkle (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: af389c4e4326a685577081e5640972ca

Issue Description:

let formatter = NumberFormatter()
formatter.numberStyle = .scientific
formatter.format = "0.#E+0"
formatter.exponentSymbol = "e"
formatter.minimumFractionDigits = 1
formatter.maximumFractionDigits = 1
let num : Float = 80
print(formatter.string(from: NSNumber(value: num))!)

macOS, swift 5.5
output: 8.0e+1

Docker, swift 5.5
output: 8e+1

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