mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.1 KiB
1.1 KiB
| layout |
|---|
| default |
Function splitUnit #
Split a unit in an array of units whose sum is equal to the original unit.
Syntax #
splitUnit(unit: Unit, parts: Array.<Unit>)
Parameters #
| Parameter | Type | Description |
|---|---|---|
parts |
Array | An array of strings or valueless units. |
Returns #
| Type | Description |
|---|---|
| Array | An array of units. |
Examples #
math.splitUnit(new Unit(1, 'm'), ['feet', 'inch']);
// [ 3 feet, 3.3700787401575 inch ]