feat: adjusted memory format to be more readable (#2416)

This commit is contained in:
Serhiy Mytrovtsiy
2025-02-26 19:26:03 +01:00
parent 42d5409a70
commit e4e447f83d

View File

@@ -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
}