| ... | ... | @@ -404,9 +404,11 @@ fn formatValue( |
| 404 | 404 | output: fn (@typeOf(context), []const u8) Errors!void, |
| 405 | 405 | ) Errors!void { |
| 406 | 406 | if (comptime std.mem.eql(u8, fmt, "B")) { |
| 407 | // TODO https://github.com/ziglang/zig/issues/2725 |
| 407 | 408 | if (options.width) |w| return formatBytes(value, w, 1000, context, Errors, output); |
| 408 | 409 | return formatBytes(value, null, 1000, context, Errors, output); |
| 409 | 410 | } else if (comptime std.mem.eql(u8, fmt, "Bi")) { |
| 411 | // TODO https://github.com/ziglang/zig/issues/2725 |
| 410 | 412 | if (options.width) |w| return formatBytes(value, w, 1024, context, Errors, output); |
| 411 | 413 | return formatBytes(value, null, 1024, context, Errors, output); |
| 412 | 414 | } |
| ... | ... | @@ -458,6 +460,7 @@ pub fn formatIntValue( |
| 458 | 460 | @compileError("Unknown format string: '" ++ fmt ++ "'"); |
| 459 | 461 | } |
| 460 | 462 | |
| 463 | // TODO https://github.com/ziglang/zig/issues/2725 |
| 461 | 464 | if (options.width) |w| return formatInt(int_value, radix, uppercase, w, context, Errors, output); |
| 462 | 465 | return formatInt(int_value, radix, uppercase, 0, context, Errors, output); |
| 463 | 466 | } |
| ... | ... | @@ -471,11 +474,13 @@ fn formatFloatValue( |
| 471 | 474 | output: fn (@typeOf(context), []const u8) Errors!void, |
| 472 | 475 | ) Errors!void { |
| 473 | 476 | if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) { |
| 477 | // TODO https://github.com/ziglang/zig/issues/2725 |
| 474 | 478 | if (options.precision) |p| return formatFloatScientific(value, p, context, Errors, output); |
| 475 | 479 | return formatFloatScientific(value, null, context, Errors, output); |
| 476 | 480 | } else if (comptime std.mem.eql(u8, fmt, "d")) { |
| 481 | // TODO https://github.com/ziglang/zig/issues/2725 |
| 477 | 482 | if (options.precision) |p| return formatFloatDecimal(value, p, context, Errors, output); |
| 478 | | return formatFloatDecimal(value, options.precision, context, Errors, output); |
| 483 | return formatFloatDecimal(value, null, context, Errors, output); |
| 479 | 484 | } else { |
| 480 | 485 | @compileError("Unknown format string: '" ++ fmt ++ "'"); |
| 481 | 486 | } |