using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Data; namespace Tango.MachineStudio.Statistics.Converters { public class NanoLiterToLiterFormatConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { try { var longValue = System.Convert.ToUInt64(value.ToString()); double val = (longValue / 1000000000d); if (parameter is string) { string format= (string)parameter; return val.ToString(format); } return val.ToString(); } catch { } return ""; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }