Tuesday, 13 August 2013

digit value to array in javascript

digit value to array in javascript

I have number 8939, then I want to get the array of the number
[8000,7000,6000,5000,4000,3000,2000,1000] and example if I have 340 then I
can get the array of 300,200,100.
I just knew that , if I user
i = i/1000 * 1000
Then I can round down 8939 to 8000, but I don't know how can I got the
result that I want above.

No comments:

Post a Comment