Skip to content

Instantly share code, notes, and snippets.

@phiggins42
Created June 25, 2010 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save phiggins42/453135 to your computer and use it in GitHub Desktop.
Save phiggins42/453135 to your computer and use it in GitHub Desktop.
$.fn.format = function(opts){
var o = $.extend({}, defaults.format, opts), codez = formatCodes(o.locale);
return this.each(function(){
var me = $(this), isinput = me.is(":input"),
n = me[(isinput ? "val" : "text")]
;
n.call(me, formatNumber(n.call(me), o, codez));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment