<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://www.netlobo.com/commentsrss.php?aid=95" rel="self" type="application/rss+xml" />
		<title>Comments on: Javascript Number Formatting</title>
		<description>A collection of number formatting functions for javascript that are free to copy and use</description>
		<link>http://www.netlobo.com/comments/javascript-number-format</link>
		<language>en-us</language>
		<copyright>Copyright 2010, Netlobo.com</copyright>
		<lastBuildDate>Fri, 23 Jan 2009 16:24:39 GMT</lastBuildDate>
		<generator>Netlobo In-house RSS v1.4</generator>
		<item>
			<title>wilq32</title>
			<description>RikArends function does not work (check many diffrent numbers), but intresetring idea :). Here is mine function with one line with defining limiter:&lt;br /&gt;
&lt;br /&gt;
numberFormat = function (number,limiter)&lt;br /&gt;
{&lt;br /&gt;
	return ((arguments[2] = number.toString().replace(new RegExp(&amp;quot;(\\d+)(\\d{3})($|&amp;quot;+limiter+&amp;quot;)&amp;quot;),'$1'+limiter+'$2$3')) == number) ? arguments[2] : arguments.callee(arguments[2],limiter);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
alert(numberFormat(423523452345,&amp;quot;.&amp;quot;));</description>
			<link>http://www.netlobo.com/comments/javascript-number-format#comment-391</link>
			<guid>http://www.netlobo.com/comments/javascript-number-format#comment-391</guid>
			<pubDate>Fri, 23 Jan 2009 08:44:17 GMT</pubDate>
		</item>
		<item>
			<title>RikArends</title>
			<description>Hi, &lt;br /&gt;
&lt;br /&gt;
Couldn't help it had to rewrite using proper regexp. These are functionally equivalent to your code including removing non-starting -'s and the . if there are more than 1:&lt;br /&gt;
This code is most likely a lot faster. &lt;br /&gt;
&lt;br /&gt;
function numberFormat(s){&lt;br /&gt;
    var r=[];&lt;br /&gt;
    String(s).replace(/(\d{3})|(\..*)/g,function(m,a,x){r.push(r.length&amp;amp;&amp;amp;a?',':'',a?a:x)});&lt;br /&gt;
    return r.join('');&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function stripNonNumeric(s){&lt;br /&gt;
    var d = 0;&lt;br /&gt;
    return String(s).replace(/[^0-9.-]/g,'').replace(/(.+)\-/g,'$1').replace(/\./,function(m){return d++?'':m;});&lt;br /&gt;
}&lt;br /&gt;
</description>
			<link>http://www.netlobo.com/comments/javascript-number-format#comment-356</link>
			<guid>http://www.netlobo.com/comments/javascript-number-format#comment-356</guid>
			<pubDate>Sat, 08 Nov 2008 03:47:37 GMT</pubDate>
		</item>
		<item>
			<title>Jaganathan</title>
			<description>function formatWithComma(number) {&lt;br /&gt;
    var formattedNumberString = (number%1000).toString();&lt;br /&gt;
    var x = parseInt(number/1000);&lt;br /&gt;
    while(x &amp;gt; 0) {&lt;br /&gt;
        formattedNumberString = x%1000 + ',' + formattedNumberString;&lt;br /&gt;
        x = parseInt(x/1000);&lt;br /&gt;
    }    &lt;br /&gt;
    return formattedNumberString;&lt;br /&gt;
}</description>
			<link>http://www.netlobo.com/comments/javascript-number-format#comment-262</link>
			<guid>http://www.netlobo.com/comments/javascript-number-format#comment-262</guid>
			<pubDate>Wed, 25 Jun 2008 09:08:59 GMT</pubDate>
		</item>
		<item>
			<title>lobo235</title>
			<description>idenise,&lt;br /&gt;
&lt;br /&gt;
To put the number in a text box you would need to know the id of the text box and then do something like this:&lt;br /&gt;
&lt;br /&gt;
document.getElementById('textboxid').value=numberFormat(12345);&lt;br /&gt;
&lt;br /&gt;
Let us know if you need more help and thanks for stopping by the site!</description>
			<link>http://www.netlobo.com/comments/javascript-number-format#comment-182</link>
			<guid>http://www.netlobo.com/comments/javascript-number-format#comment-182</guid>
			<pubDate>Thu, 31 Jan 2008 20:15:37 GMT</pubDate>
		</item>
		<item>
			<title>idenise</title>
			<description>This is exactly what I was looking for except I can't figure out how to make it work.  I've never encountered the innerHTML format so I'm off to google it.  I need to put the results into a text box.  Can that be done?  Thanks in advance if you can!</description>
			<link>http://www.netlobo.com/comments/javascript-number-format#comment-181</link>
			<guid>http://www.netlobo.com/comments/javascript-number-format#comment-181</guid>
			<pubDate>Thu, 31 Jan 2008 17:21:53 GMT</pubDate>
		</item>
	</channel>
</rss>

<!-- pageGen: 0.0019 secs -->
<!-- memcache hits: 2 memcache misses: 0 -->