Have ideas to improve npm?Join in the discussion! »

@sovpro/split-float

1.0.1 • Public • Published

Split Float

Split a floating number into two arrays or two iterable values of single-digit numbers.

Build status for Node.js 4.x and newer

Split into two arrays

let split_arrays = splitFloat (123.456)
let integer_digits = split_arrays[0]
let floating_digits = split_arrays[1]

Split into two iterable values

let split_iterables = splitNum.lazy (123.456)
let integer_sigits = split_iterables[0]
let floating_sigits = split_iterables[1]
for (let digit of integer_digits) {
  // ... do stuff with integer digit
}
for (let digit of floating_digits) {
  // ... do stuff with floating digit
}

Install

npm i @sovpro/split-float

DownloadsWeekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.26 kB

Total Files

4

Last publish

Collaborators

  • avatar