Skip to main content
Version: 7.2.0

convertLength

Description

Converts a length from one unit to another.

Parameters

NameTypeDescription
lengthnumberLength to be converted
originalUnit?UnitsInput length unit (default "kilometers")
finalUnit?UnitsReturned 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(...);