mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
round parse floats
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
bf8900b6a5
commit
54d2c00d17
1 changed files with 1 additions and 0 deletions
|
@ -419,6 +419,7 @@ const baseValues = {
|
||||||
},
|
},
|
||||||
round(arg, decimals = 0) {
|
round(arg, decimals = 0) {
|
||||||
if (isNaN(arg)) return 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);
|
return decimals === 0 ? Math.round(arg) : arg.toFixed(decimals);
|
||||||
},
|
},
|
||||||
floor(arg) {
|
floor(arg) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue