space between CurrencySymbol and value, how?

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 3.5

System.Globalization.NumberFormatInfo nfi = new
System.Globalization.NumberFormatInfo();
nfi.CurrencyDecimalDigits = 0;
nfi.CurrencyGroupSeparator = "";
nfi.CurrencySymbol = "kr";
litPrice.Text = String.Format(nfi, "{0:c}", price); <<-- price is a
variable of type decimal

when this code is executed, it gives this output:
kr23

instead I would like it to be like this (notice the space between kr and
23):
kr 23

How do I accomplish this?
 
hi

asp.net 3.5

System.Globalization.NumberFormatInfo nfi = new
System.Globalization.NumberFormatInfo();
nfi.CurrencyDecimalDigits = 0;
nfi.CurrencyGroupSeparator = "";
nfi.CurrencySymbol = "kr";
litPrice.Text = String.Format(nfi, "{0:c}", price);  <<-- price is a
variable of type decimal

when this code is executed, it gives this output:
kr23

instead I would like it to be like this (notice the space between kr and
23):
kr 23

How do I accomplish this?

I think you need simply need to set

nfi.CurrencySymbol = "kr ";

Using CultureInfo("da-DK") gives you correct result (kr 23)
 
Back
Top