18 lines
398 B
C#
18 lines
398 B
C#
namespace AntDesign.WPF.Converters;
|
|
|
|
using System;
|
|
using System.Globalization;
|
|
public class DivisionConverter : ArithmeticConverter
|
|
{
|
|
public override double Convert(double value, Type targetType, double parameter, CultureInfo culture)
|
|
{
|
|
// Divisor cannot be 0
|
|
if (parameter == 0.0)
|
|
{
|
|
return value;
|
|
}
|
|
|
|
return value / parameter;
|
|
}
|
|
}
|