Last active
October 10, 2016 09:02
-
-
Save think2011/b34eb014df7df993b0c12d151cbbbe62 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
//改自:http://blog.csdn.net/aimingoo/article/details/4492592 | |
var len = ('' + num).length; | |
return (Array( | |
fill > len ? fill - len + 1 || 0 : 0 | |
).join(0) + num); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment