1
0

OpcityConvert.cs 586 B

1234567891011121314151617181920
  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Data;
  4. namespace GeekDesk.Converts
  5. {
  6. public class OpcityConvert : IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  9. {
  10. double val = double.Parse(value.ToString());
  11. return (double)(Math.Round((decimal)(val / 100.00), 2));
  12. }
  13. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. throw new NotImplementedException();
  16. }
  17. }
  18. }