convertLength
Description
Converts a length from one unit to another.
Parameters
| Name | Type | Description |
|---|---|---|
| length | number | Length to be converted |
| originalUnit? | Units | Input length unit (default "kilometers") |
| finalUnit? | Units | Returned length unit (default "kilometers") |
Returns
number The converted length
Installation
$ npm install @turf/helpers
import { convertLength } from "@turf/helpers";
const result = convertLength(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.convertLength(...);