函数 splitUnit #
将一个单位拆分成一个单位数组,这些单位的总和等于原始单位。
Syntax #
math.splitUnit(unit: Unit, parts: Array.<Unit>)
Parameters #
| Parameter | Type | Description |
|---|---|---|
parts |
Array | 字符串或无值单位的数组。 |
Returns #
| Type | Description |
|---|---|
| Array | 单位的数组。 |
Throws #
Type | Description —- | ———–
Examples #
math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])
// [ 3 feet, 3.3700787401575 inch ]