Skip to content

Commit

Permalink
fix lint errors (issue wladich#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
myadzel committed Dec 3, 2022
1 parent 711c835 commit 2f0c1f7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/lib/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
const formatTrackLength = (length, nullable) => {
function formatTrackLength(len, nullable) {
let digits = 0;

if (length < 10000) {
if (len < 10000) {
digits = 2;
} else if (length < 100000) {
} else if (len < 100000) {
digits = 1;
}

const fixed = (length / 1000).toFixed(digits);
const fixed = (len / 1000).toFixed(digits);

return (nullable ? fixed : Number(fixed)) + ' km';
};
}

export {
formatTrackLength,
};
export {formatTrackLength};

0 comments on commit 2f0c1f7

Please sign in to comment.