convertLength
描述
¥Description
Converts a length from one unit to another.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
length | number | 待转换的长度 |
originalUnit? | 单位 | Input length unit (default "kilometers") |
finalUnit? | 单位 | Returned length unit (default "kilometers") |
返回
¥Returns
number 转换后的长度
¥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(...);