convertLength
描述
🌐 Description
将长度从一个单位转换为另一个单位。
🌐 Converts a length from one unit to another.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| length | number | 要转换的长度 |
| originalUnit? | Units | 输入长度单位 (默认“公里”) |
| finalUnit? | Units | 返回的长度单位 (默认 "公里") |
返回
🌐 Returns
number 转换后的长度
安装
🌐 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(...);