From 0df2c9e6cb30721628bae20985a8ecee3eab8c2e Mon Sep 17 00:00:00 2001 From: Chantsova Ekaterina Date: Thu, 24 Dec 2020 12:51:00 +0200 Subject: [PATCH] Prevent unnecessarily converting strings to numbers --- .../home/components/import-export/import-export.models.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts b/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts index cd37c43223..2abc8d8317 100644 --- a/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts +++ b/ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts @@ -146,7 +146,7 @@ function splitCSV(str: string, sep: string): string[] { function isNumeric(str: any): boolean { str = str.replace(',', '.'); - return !isNaN(parseFloat(str)) && isFinite(str); + return (str - parseFloat(str) + 1) >= 0 && Number(str).toString() === str; } function convertStringToJSType(str: string): any {