3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

round parse floats

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2023-10-09 09:47:36 +00:00 committed by GitHub
parent bf8900b6a5
commit 54d2c00d17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -419,6 +419,7 @@ const baseValues = {
},
round(arg, decimals = 0) {
if (isNaN(arg)) return 0;
if (typeof arg !== "number") arg = parseFloat(arg); // should be safe since we check above if it's not a number
return decimals === 0 ? Math.round(arg) : arg.toFixed(decimals);
},
floor(arg) {