Skip to content

Commit a758827

Browse files
David DunnDavid Dunn
authored andcommitted
Update ByteCountFormatter to work with updated NumberFormatter
1 parent 9daee65 commit a758827

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Foundation/NSByteCountFormatter.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,9 @@ open class ByteCountFormatter : Formatter {
296296
return partsToIncludeFor(value: result!, unit: unit)
297297
} else {
298298
if lengthOfInt(number: Int(bytes)) == 3 {
299+
numberFormatter.usesSignificantDigits = false
299300
numberFormatter.maximumFractionDigits = 1
300301
} else {
301-
numberFormatter.usesSignificantDigits = true
302302
numberFormatter.maximumSignificantDigits = 3
303303
numberFormatter.minimumSignificantDigits = 3
304304
}
@@ -345,7 +345,6 @@ open class ByteCountFormatter : Formatter {
345345
if lengthOfInt(number: Int(bytes)) > 3 {
346346
numberFormatter.maximumFractionDigits = 0
347347
} else {
348-
numberFormatter.usesSignificantDigits = true
349348
numberFormatter.maximumSignificantDigits = 3
350349
}
351350
let result = numberFormatter.string(from: NSNumber(value: bytes))

0 commit comments

Comments
 (0)