<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Number Format - Thousand Separator in AS3</title>
	<atom:link href="http://flassari.is/2009/08/number-format-thousand-separator-in-as3/feed/" rel="self" type="application/rss+xml" />
	<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/</link>
	<description></description>
	<lastBuildDate>Wed, 09 May 2012 13:29:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: Spiroszaf</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-955</link>
		<dc:creator>Spiroszaf</dc:creator>
		<pubDate>Wed, 14 Dec 2011 14:43:12 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-955</guid>
		<description>Hey! Thanks alot for sharing this. It helped me big time!</description>
		<content:encoded><![CDATA[<p>Hey! Thanks alot for sharing this. It helped me big time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gorjan</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-898</link>
		<dc:creator>Gorjan</dc:creator>
		<pubDate>Fri, 09 Dec 2011 16:21:42 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-898</guid>
		<description>Great stuff. Thanks for saving me some time when I had none :)</description>
		<content:encoded><![CDATA[<p>Great stuff. Thanks for saving me some time when I had none :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mgcool</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-714</link>
		<dc:creator>Mgcool</dc:creator>
		<pubDate>Wed, 16 Nov 2011 23:28:22 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-714</guid>
		<description>This is exactly what i was looking for. Regards. MX</description>
		<content:encoded><![CDATA[<p>This is exactly what i was looking for. Regards. MX</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yu-Chung Chen</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-559</link>
		<dc:creator>Yu-Chung Chen</dc:creator>
		<pubDate>Tue, 18 Oct 2011 19:26:33 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-559</guid>
		<description>works perfectly, thanks.</description>
		<content:encoded><![CDATA[<p>works perfectly, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gamefreak</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-132</link>
		<dc:creator>Gamefreak</dc:creator>
		<pubDate>Fri, 06 May 2011 11:55:54 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-132</guid>
		<description>great function, thanks alot</description>
		<content:encoded><![CDATA[<p>great function, thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julianne Santos</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-68</link>
		<dc:creator>Julianne Santos</dc:creator>
		<pubDate>Tue, 29 Mar 2011 01:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-68</guid>
		<description>Hi Flassari!
You saved me a lot of time!
Many many thanks from Brasil!</description>
		<content:encoded><![CDATA[<p>Hi Flassari!<br />
You saved me a lot of time!<br />
Many many thanks from Brasil!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flassari</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-67</link>
		<dc:creator>Flassari</dc:creator>
		<pubDate>Thu, 15 Apr 2010 22:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-67</guid>
		<description>The formatting was done on purpose. I know it&#039;s massively compressed and horrible to read, but it&#039;s supposed to be small and convenient to paste into timeline or code. There were other resources which had dedicated classes which are easily changeable and commented (like for beginners) at the time I made this (and still are), but I didn&#039;t want a whole class when I just wanted something quick and small to insert into the timeline.
I also don&#039;t recommend this code for mass number processing since it is not at all optimized for speed, only compactness.</description>
		<content:encoded><![CDATA[<p>The formatting was done on purpose. I know it&#8217;s massively compressed and horrible to read, but it&#8217;s supposed to be small and convenient to paste into timeline or code. There were other resources which had dedicated classes which are easily changeable and commented (like for beginners) at the time I made this (and still are), but I didn&#8217;t want a whole class when I just wanted something quick and small to insert into the timeline.<br />
I also don&#8217;t recommend this code for mass number processing since it is not at all optimized for speed, only compactness.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bractar</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-66</link>
		<dc:creator>bractar</dc:creator>
		<pubDate>Thu, 15 Apr 2010 21:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-66</guid>
		<description>nice functionality but I hate your formatting. It isn&#039;t clear enough to be updated easily. You don&#039;t need to show that you can program like a nasa guy when you give a function on the web. Most people who will use your function will be beginners...
But thank you for sharing it</description>
		<content:encoded><![CDATA[<p>nice functionality but I hate your formatting. It isn&#8217;t clear enough to be updated easily. You don&#8217;t need to show that you can program like a nasa guy when you give a function on the web. Most people who will use your function will be beginners&#8230;<br />
But thank you for sharing it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DanielSig</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-65</link>
		<dc:creator>DanielSig</dc:creator>
		<pubDate>Wed, 30 Dec 2009 16:55:25 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-65</guid>
		<description>Hey, I added a little tweak of mine to your function. What it does is that it indents the returning string with indentUnit so that the length of the string minus decimals becomes forceLength.

This can be useful when you intend to align a vertical list of numbers so that the decimal points are in a straight line.

Note: unless you specify the forceLength parameter as a uint higher than 0, this function behaves just like the original function made by Flassari.

&lt;pre class=&quot;brush: as&quot;&gt;function numberFormat(number:*, maxDecimals:int = 2, forceDecimals:Boolean = false, siStyle:Boolean = true, forceLength:uint = 0, indentUnit:String = &quot; &quot;):String {
	var i:int = 0, inc:Number = Math.pow(10, maxDecimals), str:String = String(Math.round(inc * Number(number))/inc), indent:String = &quot;&quot;;
	var hasSep:Boolean = str.indexOf(&quot;.&quot;) == -1, sep:int = hasSep ? str.length : str.indexOf(&quot;.&quot;);
	var ret:String = (hasSep &amp;&amp; !forceDecimals ? &quot;&quot; : (siStyle ? &quot;,&quot; : &quot;.&quot;)) + str.substr(sep+1);
	if (forceDecimals) for (var j:int = 0; j &lt;= maxDecimals - (str.length - (hasSep ? sep-1 : sep)); j++) ret += &quot;0&quot;;
	while (i + 3 &lt; (str.substr(0, 1) == &quot;-&quot; ? sep-1 : sep)) ret = (siStyle ? &quot;.&quot; : &quot;,&quot;) + str.substr(sep - (i += 3), 3) + ret;
	if(forceLength != 0) for(j = sep + i / 3; j &lt; forceLength; j++) indent += indentUnit;
	return indent + str.substr(0, sep - i) + ret;
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hey, I added a little tweak of mine to your function. What it does is that it indents the returning string with indentUnit so that the length of the string minus decimals becomes forceLength.</p>
<p>This can be useful when you intend to align a vertical list of numbers so that the decimal points are in a straight line.</p>
<p>Note: unless you specify the forceLength parameter as a uint higher than 0, this function behaves just like the original function made by Flassari.</p>
<pre class="brush: as">function numberFormat(number:*, maxDecimals:int = 2, forceDecimals:Boolean = false, siStyle:Boolean = true, forceLength:uint = 0, indentUnit:String = " "):String {
	var i:int = 0, inc:Number = Math.pow(10, maxDecimals), str:String = String(Math.round(inc * Number(number))/inc), indent:String = "";
	var hasSep:Boolean = str.indexOf(".") == -1, sep:int = hasSep ? str.length : str.indexOf(".");
	var ret:String = (hasSep &amp;&amp; !forceDecimals ? "" : (siStyle ? "," : ".")) + str.substr(sep+1);
	if (forceDecimals) for (var j:int = 0; j &lt;= maxDecimals - (str.length - (hasSep ? sep-1 : sep)); j++) ret += &quot;0&quot;;
	while (i + 3 &lt; (str.substr(0, 1) == &quot;-&quot; ? sep-1 : sep)) ret = (siStyle ? &quot;.&quot; : &quot;,&quot;) + str.substr(sep - (i += 3), 3) + ret;
	if(forceLength != 0) for(j = sep + i / 3; j &lt; forceLength; j++) indent += indentUnit;
	return indent + str.substr(0, sep - i) + ret;
}</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Torben</title>
		<link>http://flassari.is/2009/08/number-format-thousand-separator-in-as3/#comment-64</link>
		<dc:creator>Torben</dc:creator>
		<pubDate>Tue, 24 Nov 2009 11:24:32 +0000</pubDate>
		<guid isPermaLink="false">http://flassari.is/?p=166#comment-64</guid>
		<description>Great, thanks Flassari</description>
		<content:encoded><![CDATA[<p>Great, thanks Flassari</p>
]]></content:encoded>
	</item>
</channel>
</rss>

