From The Currency "C"
Format Specifier
If the precision specifier is omitted, the default precision is
defined by the CurrencyDecimalDigits
property.
And this ms-MY
culture has 0
as a CurrencyDecimalDigits
property. That's why it doesn't have any decimal places in the result.
As a solution, you can use precision specifier as;
CultureInfo culture = new CultureInfo("ms-MY");
someLabel.Content = string.Format(culture,"{0:C2}", 1.64m); // RM1.64
Why some currencies are rounded (or they have this property set to 0,
if you prefer), but not others. Is there some rule for that?
Honestly, I don't know. But I made some research and here what I found;
Malaysia uses ringgit as a currency. It is divided into 100 sen. And with it's third series, there were be only 4 coins as; 5 sen, 10 sen, 20 sen, 50 sen.
With previous (second) series;
As of 1 April 2008, a rounding mechanism of prices to the nearest 5
sen, applied to the total bill only, is in force, which was first
announced in 2007 by Bank Negara Malaysia, in an attempt to render the
1 sen coin irrelevant.
Article: http://www.thestar.com.my/story/?file=%2f2007%2f11%2f14%2fnation%2f19460993&sec=nation&focus=1
This image kind of useful about telling you can't divide a RM by 100 because it will not be meaningful. By the way, I have to say this 0
value does not match with ISO 4217 which specifies currency designators. From Active Codes section, you can see this MYR
has 2
decimal digits in this standard.
This XML file from currency-iso.org says this as well;
<CcyNtry>
<CtryNm>MALAYSIA</CtryNm>
<CcyNm>Malaysian Ringgit</CcyNm>
<Ccy>MYR</Ccy>
<CcyNbr>458</CcyNbr>
<CcyMnrUnts>2</CcyMnrUnts>
</CcyNtry>
Also from Contemporary non-decimal currencies section in Non-decimal currency page;
Today only two countries in the world use non-decimal currencies. Both
are in Africa. These are Mauritania (1 ouguiya = 5 khoums) and
Madagascar (1 ariary = 5 iraimbilanja). However these are only
theoretically non-decimal, as in both cases the value of the main unit
is so low that the sub-unit is too small to be of any practical use
and coins of the sub-unit are no longer used
Check the other sections of this page by the way, there are really useful information about that.
This is kind of complicated in my opinion. I also connected to .NET Team as well. I will update this answer when I get feedback from them.
UPDATE 18/08/2015
As Tarek mentioned, this CurrencyDecimalDigits
property of this my-MY
culture changed as 2
in Windows 10.
And Shawn Steele (Windows and .NET Framework globalization API expert) suggests as;
Probably formatting currencies using Windows.Globalization
and
doing it by currency might be a better idea.
UPDATE 21/02/2016
Looks like this happens on Windows Server 2012 R2 again. I connected to .NET Team about this and they respond as we can use Locale Builder to create a new custom culture or edit an existing culture to change this ICURRDIGITS settings as 2
.