Float2String.cs 703 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Windows.Data;
  3. namespace CyberX8_Themes.Converters
  4. {
  5. public class Float2String : IValueConverter
  6. {
  7. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  8. {
  9. if (value == null)
  10. return string.Empty;
  11. if (double.IsNaN((double)value))
  12. return string.Empty;
  13. else
  14. return value;
  15. }
  16. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  17. {
  18. throw new NotImplementedException();
  19. }
  20. }
  21. }