Last post Nov 22, 2010 07:38 AM by florinlabou
Nov 22, 2010 01:43 AM|Jeeson Colaco|LINK
I have an Label where I need to show the value 0.00 if the culture is Englidh and 0,00 if the Culture is french. I am using the following code but it does not work. Can anyone help me? If you have also other materials related to this please share it.
string minAmount = "0.00";
DisplayLabel.Text = minAmount.ToString(NumberFormatInfo.CurrentInfo);
Nov 22, 2010 07:38 AM|florinlabou|LINK
The minimum amount should be a number (decimal for example):
DisplayLabel.Text = ((decimal)0).ToString("n2");
An IFormatProvider parameter of ToString overload is necessary only when you want to use a different one besides the one provided by the current culture.