Merge pull request #832 from Qo2770/master

[FEATURE] Add Kilometers/Hour to Miles/Hour conversion and reverse
This commit is contained in:
Angelos Chalaris
2018-10-16 20:24:41 +03:00
committed by GitHub
6 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,14 @@
### kmphToMph
Convert kilometers/hour to miles/hour.
Multiply the constant of proportionality with the argument.
```js
const kmphToMph = (kmph) => 0.621371192 * kmph;
```
```js
kmphToMph(10); // 16.09344000614692
kmphToMph(345.4); // 138.24264965280207
```

View File

@ -0,0 +1,14 @@
### mphToKmph
Convert miles/hour to kilometers/hour.
Multiply the constant of proportionality with the argument.
```js
const mphToKmph = (mph) => 1.6093440006146922 * mph;
```
```js
mphToKmph(10); // 16.09344000614692
mphToKmph(85.9); // 138.24264965280207
```