convertLength
Description
Converts a length to the requested unit. Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
Parameters
Name | Type | Description |
---|---|---|
length | number | to be converted |
originalUnit? | Units | of the length (default "kilometers") |
finalUnit? | Units | returned 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(...);