Skip to content

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

Notifications You must be signed in to change notification settings

sovpro/split-float

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

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

Topics

Resources

Stars

Watchers

Forks

Packages