Created
January 19, 2016 03:05
-
-
Save jiggzson/6de2b9aba188543cf389 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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