| ... | ... | @@ -19,11 +19,7 @@ pub fn reduceNumber(alloc: std.mem.Allocator, input: u64, comptime unit: u64, co |
| 19 | 19 | div *= unit; |
| 20 | 20 | exp += 1; |
| 21 | 21 | } |
| 22 | | return try std.fmt.allocPrint(alloc, "{d:.3} {s}{s}", .{ intToFloat(input) / intToFloat(div), prefixes[exp .. exp + 1], base }); |
| 23 | | } |
| 24 | | |
| 25 | | pub fn intToFloat(n: u64) f64 { |
| 26 | | return @intToFloat(f64, n); |
| 22 | return try std.fmt.allocPrint(alloc, "{d:.3} {s}{s}", .{ @intToFloat(f64, input) / @intToFloat(f64, div), prefixes[exp .. exp + 1], base }); |
| 27 | 23 | } |
| 28 | 24 | |
| 29 | 25 | pub fn addSentinel(alloc: std.mem.Allocator, comptime T: type, input: []const T, comptime sentinel: T) ![:sentinel]const T { |