开发者

format currency with currency symbol at the front

hi how to format the currency with euro symbols at the front. A currency formatted开发者_如何学编程 with culture fr-Fr results in currency symbols at the end and commas instead of "."


The CultureInfo class allows you to determine such settings. Many format methods (e.g. String.Format() through the IFormatProvider parameter) take a CultureInfo as parameter. You can configure a CultureInfo instance with your requirements, for example the currency symbol settings which you can set using the NumberFormat property.

If you want these settings to apply to the entire user interface, set the Thread.CurrentThread.CurrentCulture and/or the Thread.CurrentThread.CurrentUICulture property. This setting is picked up by many methods that take a CultureInfo as parameter.


Take a look at NumberFormatInfo.CurrencyPositivePattern. Here http://msdn.microsoft.com/en-us/library/system.globalization.numberformatinfo.currencypositivepattern(v=vs.110).aspx is a table with possible values. Same is for NumberFormatInfo.CurrencyNegativePattern.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜