aboutsummaryrefslogtreecommitdiff
path: root/lib/time
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-27 16:49:38 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-27 16:49:38 -0400
commitbaf990e65c62f42e45fe25ac385db9536d3f1788 (patch)
tree7b89cecde1d6cd3b600b9295e0ad22a702cd1065 /lib/time
parent1a8a8bc3e2ebd9c282db8131902f9bb5de8c03cb (diff)
Update stdlib to use `print` instead of `printf` in all cases. This
means bringing in fpconv to do float-to-string conversion and a few updates to integer and number methods for string formatting.
Diffstat (limited to 'lib/time')
-rw-r--r--lib/time/time_defs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/time/time_defs.h b/lib/time/time_defs.h
index fd8fd4f3..7afb9c16 100644
--- a/lib/time/time_defs.h
+++ b/lib/time/time_defs.h
@@ -10,7 +10,7 @@ static INLINE Text_t num_format(long n, const char *unit)
{
if (n == 0)
return Text("now");
- return Text$format((n == 1 || n == -1) ? "%ld %s %s" : "%ld %ss %s", n < 0 ? -n : n, unit, n < 0 ? "ago" : "later");
+ return Text$from_str(String(labs(n), " ", unit, (n == -1 || n == 1) ? "" : "s", n <= 0 ? " ago" : " later"));
}
static void set_local_timezone(Text_t tz)