Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
As an example, append the output format
public class DoubleConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return "";
var doubleValue = (double)value;
return $"{doubleValue}";
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
var strValue = value as string;
if (string.IsNullOrEmpty(strValue))
return 0;
if (double.TryParse(strValue, out var resultDecimal))
{
return resultDecimal;
}
return 0;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question