<?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>web development helpdesk &#187; BigDecimal</title>
	<atom:link href="http://helpdesk.objects.com.au/tag/bigdecimal/feed" rel="self" type="application/rss+xml" />
	<link>http://helpdesk.objects.com.au</link>
	<description>objects quality - the visible difference</description>
	<lastBuildDate>Sun, 17 Jul 2011 12:27:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to format value as a percentage</title>
		<link>http://helpdesk.objects.com.au/java/how-to-format-value-as-a-percentage?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-format-value-as-a-percentage</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-format-value-as-a-percentage#comments</comments>
		<pubDate>Mon, 13 Dec 2010 21:50:25 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[DecimalFormat]]></category>
		<category><![CDATA[double]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[NumberFormat]]></category>
		<category><![CDATA[percent]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1723</guid>
		<description><![CDATA[When you need to format a number as a percent you can use the &#8216;%&#8217; symbol in your DecimalFormat string. The static helper method getPercentInstance() can also be used if you don&#8217;t need complete control over the format string. When the % symbol is used the value is first multiplied by 100 before applying the [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-format-value-as-a-percentage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to round decimal value using BigDecimal</title>
		<link>http://helpdesk.objects.com.au/java/how-to-round-decimal-value-using-bigdecimal?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-round-decimal-value-using-bigdecimal</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-round-decimal-value-using-bigdecimal#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:52:36 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[decimal]]></category>
		<category><![CDATA[double]]></category>
		<category><![CDATA[rounding]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1402</guid>
		<description><![CDATA[You can use the setScale() method to control the rounding of a decimal value as shown in the following example: double value = 123.456789; BigDecimal bd = new BigDecimal(value).setScale(2, BigDecimal.ROUND_HALF_UP); System.out.println(bd); Related posts: How can I round a value up to nearest half? Standard rounding provided by BigDecimal and DecimalFormat rounds to the... How to [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-round-decimal-value-using-bigdecimal/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating BigDecimal from localized strings</title>
		<link>http://helpdesk.objects.com.au/java/creating-bigdecimal-from-localized-strings?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-bigdecimal-from-localized-strings</link>
		<comments>http://helpdesk.objects.com.au/java/creating-bigdecimal-from-localized-strings#comments</comments>
		<pubDate>Sat, 14 Nov 2009 23:49:01 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[DecimalFormat]]></category>
		<category><![CDATA[Locale]]></category>
		<category><![CDATA[NumberFormat]]></category>
		<category><![CDATA[parse]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=1281</guid>
		<description><![CDATA[The BigDecimal constructors do not take the Locale into account when parsing number strings. This means the following code will throw a NumberFormatException Locale.setDefault(new Locale(&#34;nl&#34;, &#34;NL&#34;)); String s = &#34;2.343.298,09324798&#34;; BigDecimal bd = new BigDecimal(s); To parse localized strings as BigDecimal we instead need to use the DecimalFormat class Locale.setDefault(new Locale(&#34;nl&#34;, &#34;NL&#34;)); String s = [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/creating-bigdecimal-from-localized-strings/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to convert a hex string to a byte array?</title>
		<link>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-convert-a-hex-string-to-a-byte-array</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array#comments</comments>
		<pubDate>Wed, 15 Apr 2009 07:22:17 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[byte array]]></category>
		<category><![CDATA[hex]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=896</guid>
		<description><![CDATA[The BigDecimal class makes this really easy as it has a method toByteArray() that returns exactly what we need. Just need to create a BigDecimal and call the method. byte[] bytes = new BigInteger(hexString, 16).toByteArray(); Related posts: How can I convert a byte array to a hex string representation? You have a couple of choices, [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-convert-a-hex-string-to-a-byte-array/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How can I round a value up to nearest half?</title>
		<link>http://helpdesk.objects.com.au/java/how-can-i-round-a-value-up-to-nearest-half?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-can-i-round-a-value-up-to-nearest-half</link>
		<comments>http://helpdesk.objects.com.au/java/how-can-i-round-a-value-up-to-nearest-half#comments</comments>
		<pubDate>Tue, 24 Feb 2009 01:44:10 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[DecimalFormat]]></category>
		<category><![CDATA[round]]></category>
		<category><![CDATA[rounding]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=813</guid>
		<description><![CDATA[Standard rounding provided by BigDecimal and DecimalFormat rounds to the nearest 0 or 1. If you instead want to round to 0, 1 or 0.5 then you need to do a little work For example to round up to 4 decimal places to the nearest 0, 1, or .5 you could use the following code. [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-can-i-round-a-value-up-to-nearest-half/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rounding strategy used by DecimalFormat?</title>
		<link>http://helpdesk.objects.com.au/java/rounding-strategy-used-by-decimalformat?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rounding-strategy-used-by-decimalformat</link>
		<comments>http://helpdesk.objects.com.au/java/rounding-strategy-used-by-decimalformat#comments</comments>
		<pubDate>Mon, 23 Feb 2009 08:57:33 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[DecimalFormat]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[rounding]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=811</guid>
		<description><![CDATA[Decimal format uses BigDecimal.ROUND_HALF_EVEN and prior to 1.6 this cannot be changed. In 1.6 a setRoundingMethod() was added to allow the rounding strategy to be changed. DecimalFormat df = NumberFormat.getNumberInstance(); df.setRoundingMode(1, RoundingMode.HALF_UP); String formatted = df.format(12.345); If you need an alternate rounding strategy prior to 1.6 then you need to use BigDecimal to do your [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/rounding-strategy-used-by-decimalformat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check two BigDecimal objects for equality?</title>
		<link>http://helpdesk.objects.com.au/java/how-to-check-two-bigdecimal-objects-for-equality?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-check-two-bigdecimal-objects-for-equality</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-check-two-bigdecimal-objects-for-equality#comments</comments>
		<pubDate>Sat, 31 Jan 2009 02:42:36 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[compareTo]]></category>
		<category><![CDATA[equals]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=584</guid>
		<description><![CDATA[Use the compareTo() method instead of the equals() method. equals() only considers two BigDecimal&#8217;s to be equal if they have same value and scale (eg. 1.25 is not equal to 1.250 when using equals() method). BigDecimal a = new BigDecimal(&#34;1.25&#34;); BigDecimal b = new BigDecimal(&#34;1.250&#34;); if (a.compareTo(b)==0) { System.out.println(&#34;They are equal&#34;); } Related posts: How [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-check-two-bigdecimal-objects-for-equality/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to format a number to a certain number of significant figures, as opposed to decimal places?</title>
		<link>http://helpdesk.objects.com.au/java/how-to-format-a-number-to-a-certain-number-of-significant-figures-as-opposed-to-decimal-places?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-format-a-number-to-a-certain-number-of-significant-figures-as-opposed-to-decimal-places</link>
		<comments>http://helpdesk.objects.com.au/java/how-to-format-a-number-to-a-certain-number-of-significant-figures-as-opposed-to-decimal-places#comments</comments>
		<pubDate>Wed, 01 Oct 2008 12:26:50 +0000</pubDate>
		<dc:creator>objects</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[BigDecimal]]></category>
		<category><![CDATA[format]]></category>

		<guid isPermaLink="false">http://helpdesk.objects.com.au/?p=333</guid>
		<description><![CDATA[That’s a job for the BigDecimal class public static String formatToSignificant(double value, int significant) { MathContext mathContext = new MathContext(significant, RoundingMode.DOWN); BigDecimal bigDecimal = new BigDecimal(value, mathContext); return bigDecimal.toPlainString(); } Related posts: How to control decimal places displayed in JTable column? Rendering of table cells is handled by instances of TableCellRenderer.... How to round decimal [...]]]></description>
		<wfw:commentRss>http://helpdesk.objects.com.au/java/how-to-format-a-number-to-a-certain-number-of-significant-figures-as-opposed-to-decimal-places/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

