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.
精彩评论