mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
feat: moved from binary to metric based size units to have the same calculation as macOS (#2230)
This commit is contained in:
@@ -382,13 +382,13 @@ extension SizeUnit: CaseIterable {
|
||||
public func toBytes(_ value: Int) -> Int {
|
||||
switch self {
|
||||
case .KB:
|
||||
return value * 1_024
|
||||
return value * 1_000
|
||||
case .MB:
|
||||
return value * 1_024 * 1_024
|
||||
return value * 1_000 * 1_000
|
||||
case .GB:
|
||||
return value * 1_024 * 1_024 * 1_024
|
||||
return value * 1_000 * 1_000 * 1_000
|
||||
case .TB:
|
||||
return value * 1_024 * 1_024 * 1_024 * 1_024
|
||||
return value * 1_000 * 1_000 * 1_000 * 1_000
|
||||
default:
|
||||
return value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user