summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/p4.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/p4.zig b/src/p4.zig
index 0f23ddd5..5319ad90 100644
--- a/src/p4.zig
+++ b/src/p4.zig
@@ -722,8 +722,9 @@ fn cup(row: u16, col: u16) !void {
try emitRaw(b[0..i]);
}
+/// Decimal, least significant digit first into a scratch buffer and then reversed. Five digits is
+/// every `u16`, so there is no fallback to `std.fmt` and no value this cannot write.
fn dec(buf: []u8, v: u16) usize {
- if (v >= 10000) return std.fmt.printInt(buf, v, 10, .lower, .{});
var digits: [5]u8 = undefined;
var n: usize = 0;
var rest = v;