Created
July 17, 2011 21:26
-
-
Save ydnax/1088080 to your computer and use it in GitHub Desktop.
very ugly and not 100% working fuction to print numbers with a fixed length. don't use this!
This file contains 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
Number.prototype.fixedString=function(l){ | |
var s=new String(this.toPrecision(l)); | |
return s.substring(0, l); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment