...

View Full Version : formating numbers for a text box



philip2981
07-31-2002, 07:15 PM
I'm looking to format numbers

XXX,XXX.XX

X.XX

etc.

Help would be wonderful.

Thanks

jkd
07-31-2002, 07:22 PM
http://www.codingforums.com/showthread.php?s=&threadid=1907

And more specifically:


Number.prototype.prettyPrint = function() {
return this.toFixed(2).split('').reverse().join('').replace(/(\d{3}(?=\d))/g,'$1,').split('').reverse().join('');
}

philip2981
07-31-2002, 07:27 PM
Thanks

this should help :-D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum