From ab6e7419f3b0395a690b14ca8118defaae3c09ec Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Mon, 9 Dec 2024 01:35:21 +0100 Subject: [PATCH] bugfixing --- src/routes/stock-screener/workers/filterWorker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/stock-screener/workers/filterWorker.ts b/src/routes/stock-screener/workers/filterWorker.ts index e10125a6..058772e7 100644 --- a/src/routes/stock-screener/workers/filterWorker.ts +++ b/src/routes/stock-screener/workers/filterWorker.ts @@ -74,12 +74,12 @@ function convertUnitToValue(input: string | number | string[]) { if (nonNumericValues.has(lowerInput)) return input; // Handle percentage values - if (input.endsWith("%")) { - const numericValue = parseFloat(input.slice(0, -1)); // Remove '%' and convert to number + if (input?.endsWith("%")) { + const numericValue = parseFloat(input?.slice(0, -1)); // Remove '%' and convert to number if (isNaN(numericValue)) { return input; // Return original input if conversion fails } - return numericValue / 100; // Convert percentage to a decimal + return numericValue //numericValue / 100; // Convert percentage to a decimal } // Handle units (B, M, K)