Featured Post from richyrich
by
on April 7th, 2011 at 10:15 AM
I wanted to be able to format numbers to include commas every 3 numbers and then fix them to a certain number of decimals. There are a few different format functions out there and also JQuery plugins, but couldn't seem to find one that did exactly what I wanted, so ended up writing my own.
Here's the code for anyone else looking for something that will format numbers to include commas using JQuery:-
Code:
(function ($) {
$.fn.formatNumber = function (seperator, every,
...