From d6ede0b404232680780632805f14b4c3fc682cfe Mon Sep 17 00:00:00 2001 From: TopchetoEU <36534413+TopchetoEU@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:52:01 +0300 Subject: [PATCH] fix: incorrect toFixed behavior --- src/java/me/topchetoeu/jscript/lib/NumberLib.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/java/me/topchetoeu/jscript/lib/NumberLib.java b/src/java/me/topchetoeu/jscript/lib/NumberLib.java index 29a22fb..07eb00b 100644 --- a/src/java/me/topchetoeu/jscript/lib/NumberLib.java +++ b/src/java/me/topchetoeu/jscript/lib/NumberLib.java @@ -91,6 +91,7 @@ public class NumberLib { var digits = args.getInt(0, 0); var nf = NumberFormat.getNumberInstance(); + nf.setMinimumFractionDigits(digits); nf.setMaximumFractionDigits(digits); return nf.format(args.getDouble(-1));