From c0f3ac11f0b2a29ae62b7532ba5f13bf23f08cfd Mon Sep 17 00:00:00 2001 From: Tiago R Date: Mon, 9 Oct 2023 09:44:10 +0000 Subject: [PATCH] floor/ceil Signed-off-by: GitHub --- backend/src/templateFormatter.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/src/templateFormatter.ts b/backend/src/templateFormatter.ts index 11c17925..9e5e7856 100644 --- a/backend/src/templateFormatter.ts +++ b/backend/src/templateFormatter.ts @@ -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;