Created
December 22, 2014 15:35
-
-
Save RobertFischer/589724f3d56104259161 to your computer and use it in GitHub Desktop.
That's some fine golf you got there...
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
{ | |
toFixed: function(num) { | |
return num.toFixed(0).replace(/./g, function(c, i, a) { | |
return i > 0 && c !== "." && (a.length - i) % 3 === 0 ? "," + c : c; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment