mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
38 lines (22 loc) • 648 B
Markdown
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# Function splitUnit
Split a unit in an array of units whose sum is equal to the original unit.
## Syntax
```js
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
```js
math.splitUnit(new Unit(1, 'm'), ['feet', 'inch'])
// [ 3 feet, 3.3700787401575 inch ]
```
## See also
[unit](unit.md)