Skip to content

Instantly share code, notes, and snippets.

@jiggzson
Created January 19, 2016 03:05
Show Gist options
  • Save jiggzson/6de2b9aba188543cf389 to your computer and use it in GitHub Desktop.
Save jiggzson/6de2b9aba188543cf389 to your computer and use it in GitHub Desktop.
var toNumberPlace = function(n) {
var number = String(n),
l = number.length,
zeroes = l-1,
places = [];
for(var i=0; i<l; i++) {
var digit = Number(number.charAt(i));
places.push(digit * Math.pow(10, zeroes--));
}
return places;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment