Skip to content

Commit c759811

Browse files
authored
Merge pull request #1479 from spevans/pr_lengthformatter_darwin_compat
2 parents b3e1bd0 + 87bfc6f commit c759811

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Foundation/LengthFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ open class LengthFormatter : Formatter {
173173
.centimeter:UnitLength.centimeters.symbol,
174174
.meter:UnitLength.meters.symbol,
175175
.kilometer:UnitLength.kilometers.symbol,
176-
.inch:"\"",
176+
.inch:"",
177177
.foot:"",
178178
.yard:UnitLength.yards.symbol,
179179
.mile:UnitLength.miles.symbol]

TestFoundation/TestLengthFormatter.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,12 @@ class TestLengthFormatter: XCTestCase {
9696

9797
func test_stringFromValue() {
9898
formatter.unitStyle = Formatter.UnitStyle.long
99-
//Commented out due to [SR-3391] which causes NumberFormatter to strip leading integer 0
100-
//XCTAssertEqual(formatter.string(fromValue: 0.002, unit: LengthFormatter.Unit.millimeter),"0.002 millimeters")
99+
XCTAssertEqual(formatter.string(fromValue: 0.002, unit: LengthFormatter.Unit.millimeter),"0.002 millimeters")
101100
XCTAssertEqual(formatter.string(fromValue:0, unit:LengthFormatter.Unit.centimeter), "0 centimeters")
102101

103102
formatter.unitStyle = Formatter.UnitStyle.short
104103
XCTAssertEqual(formatter.string(fromValue: 0.00000001, unit:LengthFormatter.Unit.foot), "0′")
105-
XCTAssertEqual(formatter.string(fromValue: 2.4, unit: LengthFormatter.Unit.inch), "2.4\"")
104+
XCTAssertEqual(formatter.string(fromValue: 2.4, unit: LengthFormatter.Unit.inch), "2.4")
106105
XCTAssertEqual(formatter.string(fromValue: 123456, unit: LengthFormatter.Unit.yard), "123,456yd")
107106

108107
formatter.unitStyle = Formatter.UnitStyle.medium

0 commit comments

Comments
 (0)