Browse Source

Prevent unnecessarily converting strings to numbers

pull/3893/head
Chantsova Ekaterina 6 years ago
parent
commit
0df2c9e6cb
  1. 2
      ui-ngx/src/app/modules/home/components/import-export/import-export.models.ts

2
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 {

Loading…
Cancel
Save