<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Insert Thousands Delimiter using RegExps in Actionscript</title>
	<atom:link href="http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/</link>
	<description>There is no universally agreed-upon biological definition of dreaming</description>
	<pubDate>Fri, 21 Nov 2008 12:18:38 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Flash Animation</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-415</link>
		<dc:creator>Flash Animation</dc:creator>
		<pubDate>Tue, 08 Jul 2008 01:27:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-415</guid>
		<description>nice thx man :)</description>
		<content:encoded><![CDATA[<p>nice thx man <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idoru</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-409</link>
		<dc:creator>Idoru</dc:creator>
		<pubDate>Wed, 02 Jul 2008 18:46:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-409</guid>
		<description>Hi Hak,
This is just to deal with strings, it has nothing to do with either away3d or pv3d. But if you're after speed PV3d is the way to go.</description>
		<content:encoded><![CDATA[<p>Hi Hak,<br />
This is just to deal with strings, it has nothing to do with either away3d or pv3d. But if you&#8217;re after speed PV3d is the way to go.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hak</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-405</link>
		<dc:creator>Hak</dc:creator>
		<pubDate>Fri, 27 Jun 2008 17:24:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-405</guid>
		<description>Is this code to speed up the movement and take less strain from the CPU? I need to decrease the usage of the cpu when using papervision. How do I do that. I know this is for Away3D but we are using papervision. What is the upside of using Away3D as compared to papervision?</description>
		<content:encoded><![CDATA[<p>Is this code to speed up the movement and take less strain from the CPU? I need to decrease the usage of the cpu when using papervision. How do I do that. I know this is for Away3D but we are using papervision. What is the upside of using Away3D as compared to papervision?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idoru</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-378</link>
		<dc:creator>Idoru</dc:creator>
		<pubDate>Tue, 10 Jun 2008 07:44:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-378</guid>
		<description>Nice one Sev, 
And speed is important but sometimes having a regExp just gives you a little more flexibility, but clearly you've got it right on the speed part :)</description>
		<content:encoded><![CDATA[<p>Nice one Sev,<br />
And speed is important but sometimes having a regExp just gives you a little more flexibility, but clearly you&#8217;ve got it right on the speed part <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sev</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-377</link>
		<dc:creator>Sev</dc:creator>
		<pubDate>Mon, 09 Jun 2008 23:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-377</guid>
		<description>this one is even faster (the longer the string, the better the improvement)

'100000000000000000000000000000000000000000000000 00000000000000000000' - 60x faster!!!

'1000000' - 10x faster

i'm sure other people could improve even more (i love speed!) :)

public function thousands_char(value:String):String
{
	var l : int = value.length;
	var result : String = '';
	var i : int = 0;
	while ( i  0 &#38;&#38; (l-i) % 3 == 0 ) result += '.';
		result += value.charAt(i);
		i++;
	}
	return result;
}</description>
		<content:encoded><![CDATA[<p>this one is even faster (the longer the string, the better the improvement)</p>
<p>&#8216;100000000000000000000000000000000000000000000000 00000000000000000000&#8242; - 60x faster!!!</p>
<p>&#8216;1000000&#8242; - 10x faster</p>
<p>i&#8217;m sure other people could improve even more (i love speed!) <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>public function thousands_char(value:String):String<br />
{<br />
	var l : int = value.length;<br />
	var result : String = &#8221;;<br />
	var i : int = 0;<br />
	while ( i  0 &amp;&amp; (l-i) % 3 == 0 ) result += &#8216;.&#8217;;<br />
		result += value.charAt(i);<br />
		i++;<br />
	}<br />
	return result;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sev</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-376</link>
		<dc:creator>Sev</dc:creator>
		<pubDate>Mon, 09 Jun 2008 23:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-376</guid>
		<description>While I really like regexp (especially for find/replace in code), I think it's too slow for simple text operations. I actually try to avoid it wherever possible due to some tests I've done. To give an example, I recoded the functionality of the above function with some simple (and not at all polished) text ops:

public function thousands_fast(value:String):String
{
	var l : int = value.length;
	var result : String = value.substr( Math.max(l-4,0) , 3 );
	for ( var i : int = l-4 ; i &#62;= 0 ; i-- ) {
		if ( ( l - i - 1 ) % 3 == 0 ) result = '.' + result;
		result = value.substr(i,1) + result;
	}
	return result;
}

It doesn't look nice. But it's MORE THAN 10x faster! To me, that makes all the difference. I even do complex parsing all by myself (you know, indexOf, split, substr and that kind of stuff), just because in the end it's so much faster. Unfortunately. (I know of course that you made this for fun and not because you thought it would be the best solution, but hey, I kind of felt the need to shout this out for once ;-)</description>
		<content:encoded><![CDATA[<p>While I really like regexp (especially for find/replace in code), I think it&#8217;s too slow for simple text operations. I actually try to avoid it wherever possible due to some tests I&#8217;ve done. To give an example, I recoded the functionality of the above function with some simple (and not at all polished) text ops:</p>
<p>public function thousands_fast(value:String):String<br />
{<br />
	var l : int = value.length;<br />
	var result : String = value.substr( Math.max(l-4,0) , 3 );<br />
	for ( var i : int = l-4 ; i &gt;= 0 ; i&#8211; ) {<br />
		if ( ( l - i - 1 ) % 3 == 0 ) result = &#8216;.&#8217; + result;<br />
		result = value.substr(i,1) + result;<br />
	}<br />
	return result;<br />
}</p>
<p>It doesn&#8217;t look nice. But it&#8217;s MORE THAN 10x faster! To me, that makes all the difference. I even do complex parsing all by myself (you know, indexOf, split, substr and that kind of stuff), just because in the end it&#8217;s so much faster. Unfortunately. (I know of course that you made this for fun and not because you thought it would be the best solution, but hey, I kind of felt the need to shout this out for once <img src='http://www.dreaminginflash.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://www.dreaminginflash.com/2008/05/28/insert-thousands-delimiter-using-regexps-in-actionscript/#comment-359</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 28 May 2008 01:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dreaminginflash.com/?p=142#comment-359</guid>
		<description>Nice. Thanks for posting.</description>
		<content:encoded><![CDATA[<p>Nice. Thanks for posting.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
