@sovpro/split-float
v1.0.1
Published
Split a floating number into two arrays or two iterable values of single-digit numbers
Downloads
4
Readme
Split Float
Split a floating number into two arrays or two iterable values of single-digit numbers.
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
}