fmtf() assert was in wrong place.

This commit is contained in:
Revar Desmera 2020-03-05 02:11:43 -08:00
parent 05405564b4
commit 39fc4bffb5
2 changed files with 2 additions and 2 deletions

View File

@ -430,7 +430,6 @@ function fmti(i,mindigits=1) =
// fmtf(PI,12); // Returns: "3.14159265359"
// fmtf([PI,-16.75],12); // Returns: "[3.14159265359, -16.75]"
function fmtf(f,sig=12) =
assert(is_num(f))
assert(is_int(sig))
assert(sig>0)
is_list(f)? str("[",str_join(sep=", ", [for (g=f) fmtf(g,sig=sig)]),"]") :
@ -438,6 +437,7 @@ function fmtf(f,sig=12) =
str(f)=="nan"? "nan" :
str(f)=="inf"? "inf" :
f<0? str("-",fmtf(-f,sig=sig)) :
assert(is_num(f))
let(
e = floor(log(f)),
mv = sig - e - 1

View File

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,157];
BOSL_VERSION = [2,0,158];
// Section: BOSL Library Version Functions