svghmi/sprintf.js
branchpython3
changeset 3854 d29d67e86532
parent 3837 efe0b5b21842
--- a/svghmi/sprintf.js	Tue Oct 03 21:33:13 2023 +0200
+++ b/svghmi/sprintf.js	Wed Oct 04 16:24:00 2023 +0200
@@ -59,8 +59,13 @@
                     arg = arg()
                 }
 
-                if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
-                    throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
+                if (re.numeric_arg.test(ph.type)){
+                    let argtype = typeof arg;
+                    if ( argtype !== 'bigint') {
+                        if ( argtype !== 'number' && isNaN(arg) ) {
+                            throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
+                        }
+                    }
                 }
 
                 if (re.number.test(ph.type)) {