fix: incorrect toFixed behavior

This commit is contained in:
TopchetoEU 2024-04-03 15:52:01 +03:00
parent 71b40240c0
commit d6ede0b404
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -91,6 +91,7 @@ public class NumberLib {
var digits = args.getInt(0, 0); var digits = args.getInt(0, 0);
var nf = NumberFormat.getNumberInstance(); var nf = NumberFormat.getNumberInstance();
nf.setMinimumFractionDigits(digits);
nf.setMaximumFractionDigits(digits); nf.setMaximumFractionDigits(digits);
return nf.format(args.getDouble(-1)); return nf.format(args.getDouble(-1));