| ... | ... | @@ -950,13 +950,13 @@ fn formatSizeImpl(comptime base: comptime_int) type { |
| 950 | 950 | } |
| 951 | 951 | }; |
| 952 | 952 | } |
| 953 | | |
| 954 | 953 | const formatSizeDec = formatSizeImpl(1000).formatSizeImpl; |
| 955 | 954 | const formatSizeBin = formatSizeImpl(1024).formatSizeImpl; |
| 956 | 955 | |
| 957 | 956 | /// Return a Formatter for a u64 value representing a file size. |
| 958 | 957 | /// This formatter represents the number as multiple of 1000 and uses the SI |
| 959 | 958 | /// measurement units (kB, MB, GB, ...). |
| 959 | /// Format option `precision` is ignored when `value` is less than 1kB |
| 960 | 960 | pub fn fmtIntSizeDec(value: u64) std.fmt.Formatter(formatSizeDec) { |
| 961 | 961 | return .{ .data = value }; |
| 962 | 962 | } |
| ... | ... | @@ -964,6 +964,7 @@ pub fn fmtIntSizeDec(value: u64) std.fmt.Formatter(formatSizeDec) { |
| 964 | 964 | /// Return a Formatter for a u64 value representing a file size. |
| 965 | 965 | /// This formatter represents the number as multiple of 1024 and uses the IEC |
| 966 | 966 | /// measurement units (KiB, MiB, GiB, ...). |
| 967 | /// Format option `precision` is ignored when `value` is less than 1KiB |
| 967 | 968 | pub fn fmtIntSizeBin(value: u64) std.fmt.Formatter(formatSizeBin) { |
| 968 | 969 | return .{ .data = value }; |
| 969 | 970 | } |