I use a Converter for my TextBox for currency. Everything works great, except that the €-sign is after the value instead of before.
Here is the code:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var dValue = value as decimal?;
return string.Format(CultureInfo.GetCultureInfo("de-DE"), "{0:C}", dValue ?? 0);
}
I know I can easily put it before it instead of after like so:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var dValue = value as decimal?;
return "€ " + string.Format(CultureInfo.GetCultureInfo("de-DE"), "{0:C}", dValue ?? 0).Replace("€", "").Trim();
}
But I'm just assuming here that there should be a standard in the formatter itself to do this. So, does anyone know how to put the currency before the value instead of behind it using the formatter itself?
For example: With the decimal 12345678.90
, I don't want to display [see first method] 12.345.678,90 €
, but I want to display [see second method] € 12.345.678,90
instead.
try in this way
if it doesn't work try without this line
if it doesn't work again try changing CurrencyNegativePattern Property and CurrencyPositivePattern Property with the value of 2
2 means "€ + number"