<?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: How to Round Floating point number (Double) to 2 Decimal Points in J2ME JavaME</title>
	<atom:link href="http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/feed" rel="self" type="application/rss+xml" />
	<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html</link>
	<description>Mobile Phone, PDA and JavaME (J2ME) Programming Blog</description>
	<lastBuildDate>Fri, 10 Sep 2010 18:54:40 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: lark</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14915</link>
		<dc:creator>lark</dc:creator>
		<pubDate>Tue, 10 Aug 2010 21:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14915</guid>
		<description>This will round not truncate. Math.Pow is my own pow function(). 
     
        double sum = numberToRound;
        double round = .5 / Math.Pow(10, precision+1);
        sum = (sum &gt; 0) ? sum + round : sum - round;
    	int temp=(int)((sum*Math.Pow(10,precision)));
    	sum = (((double)temp)/Math.Pow(10,precision));</description>
		<content:encoded><![CDATA[<p>This will round not truncate. Math.Pow is my own pow function(). </p>
<p>        double sum = numberToRound;<br />
        double round = .5 / Math.Pow(10, precision+1);<br />
        sum = (sum &gt; 0) ? sum + round : sum &#8211; round;<br />
    	int temp=(int)((sum*Math.Pow(10,precision)));<br />
    	sum = (((double)temp)/Math.Pow(10,precision));</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: armin</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14892</link>
		<dc:creator>armin</dc:creator>
		<pubDate>Mon, 28 Jun 2010 12:35:12 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14892</guid>
		<description>??? ???

thanks</description>
		<content:encoded><![CDATA[<p>??? ???</p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricardo</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14870</link>
		<dc:creator>Ricardo</dc:creator>
		<pubDate>Fri, 14 May 2010 13:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14870</guid>
		<description>maaaaan you saved my day!!! really tks ;D</description>
		<content:encoded><![CDATA[<p>maaaaan you saved my day!!! really tks ;D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felipe</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14866</link>
		<dc:creator>Felipe</dc:creator>
		<pubDate>Fri, 07 May 2010 02:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14866</guid>
		<description>DONT WORK</description>
		<content:encoded><![CDATA[<p>DONT WORK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Léo</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14671</link>
		<dc:creator>Léo</dc:creator>
		<pubDate>Mon, 18 May 2009 17:06:47 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14671</guid>
		<description>This is not rounding, is trunking.
22.92893723062 turns into 22.9288 and not 22.9289
47.026586582836 turns 47.0265 and not 47.0266</description>
		<content:encoded><![CDATA[<p>This is not rounding, is trunking.<br />
22.92893723062 turns into 22.9288 and not 22.9289<br />
47.026586582836 turns 47.0265 and not 47.0266</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sameer Nafdey</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-14615</link>
		<dc:creator>Sameer Nafdey</dc:creator>
		<pubDate>Thu, 19 Mar 2009 05:46:27 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-14615</guid>
		<description>Awesome! Its a very small snippet but very useful. You saved my hell lot of time. Thanks man. You rocks.</description>
		<content:encoded><![CDATA[<p>Awesome! Its a very small snippet but very useful. You saved my hell lot of time. Thanks man. You rocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-11751</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Sat, 11 Oct 2008 00:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-11751</guid>
		<description>Thanks</description>
		<content:encoded><![CDATA[<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: viv</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-10438</link>
		<dc:creator>viv</dc:creator>
		<pubDate>Mon, 01 Sep 2008 17:45:20 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-10438</guid>
		<description>Thanx man</description>
		<content:encoded><![CDATA[<p>Thanx man</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ana</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-9689</link>
		<dc:creator>ana</dc:creator>
		<pubDate>Tue, 22 Jul 2008 18:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-9689</guid>
		<description>thank u very much!</description>
		<content:encoded><![CDATA[<p>thank u very much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pao</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-9276</link>
		<dc:creator>pao</dc:creator>
		<pubDate>Fri, 13 Jun 2008 23:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-9276</guid>
		<description>excelent!!!, very very ingenious. You are a genious!! very thanks</description>
		<content:encoded><![CDATA[<p>excelent!!!, very very ingenious. You are a genious!! very thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: taro</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-7886</link>
		<dc:creator>taro</dc:creator>
		<pubDate>Sun, 06 Jan 2008 08:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-7886</guid>
		<description>thanks lots!</description>
		<content:encoded><![CDATA[<p>thanks lots!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: thanasis</title>
		<link>http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html/comment-page-1#comment-2707</link>
		<dc:creator>thanasis</dc:creator>
		<pubDate>Wed, 17 Oct 2007 12:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://mobilepit.com/08/how-to-round-floating-point-number-double-to-2-decimal-points-in-j2me-javame.html#comment-2707</guid>
		<description>thnx</description>
		<content:encoded><![CDATA[<p>thnx</p>
]]></content:encoded>
	</item>
</channel>
</rss>
