From e2c0d6dc9861a8d41d247dbd0283913f44d597cf Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Sun, 14 Jun 2020 23:53:10 -0700 Subject: [PATCH] Bugfix for fmt_int() found by creating regressions. --- strings.scad | 4 ++-- version.scad | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/strings.scad b/strings.scad index 7565e17..60e0aa8 100644 --- a/strings.scad +++ b/strings.scad @@ -435,9 +435,9 @@ function str_strip(s,c) = str_strip_trailing(str_strip_leading(s,c),c); // fmt_int(123456789012345); // Returns "123456789012345" // fmt_int(-123456789012345); // Returns "-123456789012345" function fmt_int(i,mindigits=1) = - i<0? str("-", fmt_int(-i)) : + i<0? str("-", fmt_int(-i,mindigits)) : let(i=floor(i), e=floor(log(i))) - i==0? "0" : + i==0? str_join([for (j=[0:1:mindigits-1]) "0"]) : str_join( concat( [for (j=[0:1:mindigits-e-2]) "0"], diff --git a/version.scad b/version.scad index c8ed135..145023c 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,336]; +BOSL_VERSION = [2,0,337]; // Section: BOSL Library Version Functions