<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Helmut Granda &#187; Math</title>
	<atom:link href="http://www.helmutgranda.com/category/programming/math/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helmutgranda.com</link>
	<description>learning through interaction</description>
	<lastBuildDate>Mon, 19 Jul 2010 15:01:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Actionscript Round and keep decimals function</title>
		<link>http://www.helmutgranda.com/2007/03/07/actionscript-round-and-keep-decimals-function/</link>
		<comments>http://www.helmutgranda.com/2007/03/07/actionscript-round-and-keep-decimals-function/#comments</comments>
		<pubDate>Wed, 07 Mar 2007 14:53:37 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/2007/03/07/actionscript-round-and-keep-decimals-function/</guid>
		<description><![CDATA[ActionScript: function formatDecimals2 (num, digits) { if (num &#60; 0 ) { num = 0; } if (digits &#60;= 0) { return Math.round(num); } var tenToPower = Math.pow(10, digits); var cropped = String(Math.round(num * tenToPower) / tenToPower); trace(&#34;digits:&#34; + digits + &#34; - &#34; + cropped); } formatDecimals2( 35435.234234, 2); formatDecimals2( 35435.234234, 3); formatDecimals2( 35435.234234, [...]]]></description>
			<content:encoded><![CDATA[<div class="syntax_hilite"><strong>ActionScript:</strong>
<div id="as-1">
<div>
<ol style="">function formatDecimals2 (num, digits) {</p>
<p>if (num &lt; 0 ) {<br />
num = 0;<br />
}</p>
<p>if (digits &lt;= 0) {<br />
return Math.round(num);<br />
}</p>
<p>var tenToPower = Math.pow(10, digits);<br />
var cropped = String(Math.round(num * tenToPower) / tenToPower);</p>
<p>trace(&quot;digits:&quot; + digits + &quot; - &quot; + cropped);</p>
<p>}</p>
<p>formatDecimals2( 35435.234234, 2);<br />
formatDecimals2( 35435.234234, 3);<br />
formatDecimals2( 35435.234234, 4);</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2007/03/07/actionscript-round-and-keep-decimals-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
