<?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>UberCoderMonkey.com</title>
	<atom:link href="http://www.ubercodermonkey.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ubercodermonkey.com</link>
	<description>Life is coded, one line at a time.</description>
	<lastBuildDate>Tue, 09 Aug 2011 15:37:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Displaying Currency In Country&#8217;s Local Format</title>
		<link>http://www.ubercodermonkey.com/2010/11/displaying-currency-in-countrys-local-format/</link>
		<comments>http://www.ubercodermonkey.com/2010/11/displaying-currency-in-countrys-local-format/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 17:31:50 +0000</pubDate>
		<dc:creator>UberMonkey</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[currency]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.ubercodermonkey.com/archive/2010/11/03/displaying-currency-in-countrys-local-format.aspx</guid>
		<description><![CDATA[While working on a project that needed to display the currency of an item for sale in the country&#8217;s local format, I came across a nice and simple way to handle it.  Some might think of making a nice big old if/else or switch, and rolling your own formatting for each country.  The way I [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a project that needed to display the currency of an item for sale in the country&#8217;s local format, I came across a nice and simple way to handle it.  Some might think of making a nice big old if/else or switch, and rolling your own formatting for each country.  The way I found was some what similar, but taking advantage of the ToString function of the SalePrice variable, which happened to be a float.</p>
<p>The following will format the float to your current country&#8217;s currency format:</p>
<pre class="brush: csharp">float salePrice = 20.5f;
string salePriceString = salePrice.ToString("C");
Console.WriteLine(salePriceString);</pre>
<p>For US, it should output $20.50 as the salePriceString.</p>
<p>Now to handle other countries, there is a nice overload for ToString, which allows you to pass in the CultureInfo.</p>
<p>Here is how to output the same value formatted for Great Britain Pounds:</p>
<pre class="brush: csharp">float salePrice = 20.5f;
string salePriceString = salePrice.ToString("C", new CultureInfo("en-GB"));
Console.WriteLine(salePriceString);</pre>
<p>Simple enough, no? This doesn&#8217;t do any currency conversions, but it does format the float into a correct currency string.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ubercodermonkey.com/2010/11/displaying-currency-in-countrys-local-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site Launched</title>
		<link>http://www.ubercodermonkey.com/2010/09/site-launched/</link>
		<comments>http://www.ubercodermonkey.com/2010/09/site-launched/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 05:40:53 +0000</pubDate>
		<dc:creator>UberMonkey</dc:creator>
				<category><![CDATA[Site]]></category>

		<guid isPermaLink="false">http://www.ubercodermonkey.com/archive/2010/09/05/site-launched.aspx</guid>
		<description><![CDATA[Heyo Everyone! I decided to launch this site to post code and other programming related stuff instead of my main blog. My main blog will still be around for non code, more just personal updates, thoughts, etc. This blog will be housing code snippets and tutorials/articles that I write up in the near future.]]></description>
			<content:encoded><![CDATA[<p>Heyo Everyone!</p>
<p>I decided to launch this site to post code and other programming related stuff instead of my main blog. My main blog will still be around for non code, more just personal updates, thoughts, etc. This blog will be housing code snippets and tutorials/articles that I write up in the near future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ubercodermonkey.com/2010/09/site-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

