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

floor/ceil

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

View file

@ -421,6 +421,14 @@ const baseValues = {
if (isNaN(arg)) return 0;
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) {
return args.reduce((result, arg) => {
if (isNaN(arg)) return result;