From 1ec14e3c9281a8c0cf582adecad4af054e191253 Mon Sep 17 00:00:00 2001 From: Sanasar Janjughazyan Date: Thu, 12 Dec 2024 22:57:07 +0000 Subject: [PATCH] fix: remove float decimal restriction in variables sanitizer (RUN-454) (#564) **Fixes or implements RUN-454** First step to fix [this bug](https://linear.app/voiceflow/issue/RUN-453/ent-trilogy-greater-than-if-condition-incorrect-within-small-margins) --- packages/common/src/utils/variables.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/src/utils/variables.ts b/packages/common/src/utils/variables.ts index 55bbd800f..b02754f28 100644 --- a/packages/common/src/utils/variables.ts +++ b/packages/common/src/utils/variables.ts @@ -28,11 +28,11 @@ export const replaceVariables = ( ); }; -// turn float variables to 2 decimal places +// turn float variables to 4 decimal places export const sanitizeVariables = (variables: Record): Record => Object.entries(variables).reduce>((acc, [key, value]) => { if (typeof value === 'number' && !Number.isInteger(value)) { - acc[key] = (value as number).toFixed(2); + acc[key] = (value as number).toFixed(4); } else { acc[key] = value; }