aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2023-09-12 16:49:42 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2023-09-12 16:49:42 +0200
commit287beaff35479bd25aa2fb7a76eb779a3f0761c8 (patch)
treed6955d86632a491da963093fdd2ffd4ea1db3080 /core
parent93caf5b31120dec6739c098207f5b00ad7aed299 (diff)
use KiB etc. instead of KB
Diffstat (limited to 'core')
-rw-r--r--core/fmt/fmt.odin8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin
index fad2548c8..ab57209c3 100644
--- a/core/fmt/fmt.odin
+++ b/core/fmt/fmt.odin
@@ -1049,8 +1049,8 @@ _fmt_int_128 :: proc(fi: ^Info, u: u128, base: int, is_signed: bool, bit_size: i
_pad(fi, s)
}
// Units of measurements:
-__MEMORY_LOWER := " b kb mb gb tb pb eb"
-__MEMORY_UPPER := " B KB MB GB TB PB EB"
+__MEMORY_LOWER := " b kib mib gib tib pib eib"
+__MEMORY_UPPER := " B KiB MiB GiB TiB PiB EiB"
// Formats an integer value as bytes with the best representation.
//
// Inputs:
@@ -1069,13 +1069,13 @@ _fmt_memory :: proc(fi: ^Info, u: u64, is_signed: bool, bit_size: int, units: st
div, off, unit_len := 1, 0, 1
for n := abs; n >= mem.Kilobyte; n /= mem.Kilobyte {
div *= mem.Kilobyte
- off += 3
+ off += 4
// First iteration is slightly different because you go from
// units of length 1 to units of length 2.
if unit_len == 1 {
off = 2
- unit_len = 2
+ unit_len = 3
}
}