using System; using System.Diagnostics.Contracts; using Windows.UI.Xaml.Data; namespace OwlCore.WinUI.Converters.Numerical { /// /// A converter that converts a given to an . /// public class DoubleToIntConverter : IValueConverter { /// /// Converts a to a . /// /// The to convert /// The converted value. [Pure] public static int Convert(double value) => System.Convert.ToInt32(value); /// public object Convert(object value, Type targetType, object parameter, string language) { return Convert((double)value); } /// public object ConvertBack(object value, Type targetType, object parameter, string language) { return (int)(double)value; } } }