Split up an integer into even parts that add to the original integer.
Install
npm install split-integer
Usage
const splitInteger = //=> [5, 5] //=> [4, 3, 3] //=> [3, 3, 4]
API
splitInteger(number, parts, options?)
number
Type: number
The number to split.
parts
Type: number
The amount of parts to split the number into.
options
Type: object
smallestFirst
Type: boolean
Default: false
Whether to order the smallest numbers first in the resulting array.