From 54d2c00d17b1a95086de46e437a6e999a7f776bd Mon Sep 17 00:00:00 2001 From: Tiago R Date: Mon, 9 Oct 2023 09:47:36 +0000 Subject: [PATCH] round parse floats Signed-off-by: GitHub --- backend/src/templateFormatter.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/src/templateFormatter.ts b/backend/src/templateFormatter.ts index 9e5e7856..142576f4 100644 --- a/backend/src/templateFormatter.ts +++ b/backend/src/templateFormatter.ts @@ -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) {