Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / utils / Utils.ts
index d3b9872da8206bb0f840ccc975bc137302e41e91..8dda95a699b362c66c5bb195e96de4abf30e39c1 100644 (file)
@@ -70,14 +70,12 @@ export default class Utils {
     if (Number.isSafeInteger(value)) {
       return value as number;
     }
-    // Check
-    if (Utils.isString(value)) {
-      // Create Object
-      changedValue = parseInt(value as string);
-    }
     if (typeof value === 'number') {
       changedValue = Math.trunc(value);
     }
+    if (Utils.isString(value)) {
+      changedValue = parseInt(value as string);
+    }
     return changedValue;
   }
 
@@ -86,9 +84,7 @@ export default class Utils {
     if (!value) {
       return 0;
     }
-    // Check
     if (Utils.isString(value)) {
-      // Create Object
       changedValue = parseFloat(value as string);
     }
     return changedValue;