Skip to content

Commit

Permalink
fix NaN when starting with empty dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsdodo committed May 10, 2023
1 parent 7eeab06 commit 521ffe1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sygic-geotab-utils/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ export class DimensionsModel {
}

// numbers are stored with 5 decimals. Displayed and used when parsing inputs with 2 decimals.
let roundTo2Decimals = (number) => Math.round(number * 100) / 100;
let roundTo2Decimals = (number) => {
if (number !== undefined)
return Math.round(number * 100) / 100;
}

return {
width: {
Expand Down

0 comments on commit 521ffe1

Please sign in to comment.