| ... | ... | @@ -443,13 +443,9 @@ fn formatValue( |
| 443 | 443 | output: fn (@typeOf(context), []const u8) Errors!void, |
| 444 | 444 | ) Errors!void { |
| 445 | 445 | if (comptime std.mem.eql(u8, fmt, "B")) { |
| 446 | | // TODO https://github.com/ziglang/zig/issues/2725 |
| 447 | | if (options.width) |w| return formatBytes(value, w, 1000, context, Errors, output); |
| 448 | | return formatBytes(value, null, 1000, context, Errors, output); |
| 446 | return formatBytes(value, options.width, 1000, context, Errors, output); |
| 449 | 447 | } else if (comptime std.mem.eql(u8, fmt, "Bi")) { |
| 450 | | // TODO https://github.com/ziglang/zig/issues/2725 |
| 451 | | if (options.width) |w| return formatBytes(value, w, 1024, context, Errors, output); |
| 452 | | return formatBytes(value, null, 1024, context, Errors, output); |
| 448 | return formatBytes(value, options.width, 1024, context, Errors, output); |
| 453 | 449 | } |
| 454 | 450 | |
| 455 | 451 | const T = @typeOf(value); |
| ... | ... | @@ -499,9 +495,7 @@ pub fn formatIntValue( |
| 499 | 495 | @compileError("Unknown format string: '" ++ fmt ++ "'"); |
| 500 | 496 | } |
| 501 | 497 | |
| 502 | | // TODO https://github.com/ziglang/zig/issues/2725 |
| 503 | | if (options.width) |w| return formatInt(int_value, radix, uppercase, w, context, Errors, output); |
| 504 | | return formatInt(int_value, radix, uppercase, 0, context, Errors, output); |
| 498 | return formatInt(int_value, radix, uppercase, options.width orelse 0, context, Errors, output); |
| 505 | 499 | } |
| 506 | 500 | |
| 507 | 501 | fn formatFloatValue( |
| ... | ... | @@ -513,13 +507,9 @@ fn formatFloatValue( |
| 513 | 507 | output: fn (@typeOf(context), []const u8) Errors!void, |
| 514 | 508 | ) Errors!void { |
| 515 | 509 | if (fmt.len == 0 or comptime std.mem.eql(u8, fmt, "e")) { |
| 516 | | // TODO https://github.com/ziglang/zig/issues/2725 |
| 517 | | if (options.precision) |p| return formatFloatScientific(value, p, context, Errors, output); |
| 518 | | return formatFloatScientific(value, null, context, Errors, output); |
| 510 | return formatFloatScientific(value, options.precision, context, Errors, output); |
| 519 | 511 | } else if (comptime std.mem.eql(u8, fmt, "d")) { |
| 520 | | // TODO https://github.com/ziglang/zig/issues/2725 |
| 521 | | if (options.precision) |p| return formatFloatDecimal(value, p, context, Errors, output); |
| 522 | | return formatFloatDecimal(value, null, context, Errors, output); |
| 512 | return formatFloatDecimal(value, options.precision, context, Errors, output); |
| 523 | 513 | } else { |
| 524 | 514 | @compileError("Unknown format string: '" ++ fmt ++ "'"); |
| 525 | 515 | } |