From 9f1ab0231a8cea8356ff8e81ec017f3c3a163b19 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 5 Feb 2022 22:16:59 +0100 Subject: [PATCH] ntos float support --- std.isbpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/std.isbpl b/std.isbpl index 6a683e7..567d490 100644 --- a/std.isbpl +++ b/std.isbpl @@ -112,12 +112,20 @@ func ntos { "" =s =n + n 0 lt dup if { n neg =n 1 =negative } =negative n type =thetype - while n 0 eq not { + while n 1 lt not { n (n 10 % dup =x) - =n s (n '0' + _char) strconcat =s } + 1 =steps + while n 0 eq not { + n (n (1 (steps dup 10 * =steps) /) % dup =x) - =n + s (x '0' + _char) strconcat =s + } + + negative if { "-" s strconcat =s } s }