mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 14:11:50 +00:00
floor/ceil
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
5a4e50b19d
commit
c0f3ac11f0
1 changed files with 8 additions and 0 deletions
|
@ -421,6 +421,14 @@ const baseValues = {
|
||||||
if (isNaN(arg)) return 0;
|
if (isNaN(arg)) return 0;
|
||||||
return decimals === 0 ? Math.round(arg) : arg.toFixed(decimals);
|
return decimals === 0 ? Math.round(arg) : arg.toFixed(decimals);
|
||||||
},
|
},
|
||||||
|
floor(arg) {
|
||||||
|
if (isNaN(arg)) return 0;
|
||||||
|
return Math.floor(parseFloat(arg));
|
||||||
|
},
|
||||||
|
ceil(arg) {
|
||||||
|
if (isNaN(arg)) return 0;
|
||||||
|
return Math.ceil(parseFloat(arg));
|
||||||
|
},
|
||||||
add(...args) {
|
add(...args) {
|
||||||
return args.reduce((result, arg) => {
|
return args.reduce((result, arg) => {
|
||||||
if (isNaN(arg)) return result;
|
if (isNaN(arg)) return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue