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