diff --git a/Kit/helpers.swift b/Kit/helpers.swift index 6800c3c6..2aee7473 100644 --- a/Kit/helpers.swift +++ b/Kit/helpers.swift @@ -197,8 +197,10 @@ public struct Units { formatter.includesUnit = true formatter.isAdaptive = true - var value = formatter.string(fromByteCount: Int64(bytes)) - value = value.replacingOccurrences(of: ",", with: ".") + var value = formatter.string(fromByteCount: Int64(self.bytes)) + if let idx = value.lastIndex(of: ",") { + value.replaceSubrange(idx...idx, with: ".") + } return value }