aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/converter.js
blob: e48b0760eb32681b8375263244339a799ee9bfc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export const speedConverter = (value, unit) => {
  let factor;
  switch (unit) {
    case 'kmh':
      factor = 1.852;
    case 'mph':
      factor = 1.15078;
    case 'kn':
    default:
      factor = 1;
  }
  return (value * factor).toFixed(2);
};