You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
939 B
29 lines
939 B
|
2 years ago
|
using System;
|
||
|
|
using System.Globalization;
|
||
|
|
using System.Windows.Data;
|
||
|
|
|
||
|
|
namespace Audit.ConvertMoels
|
||
|
|
{
|
||
|
|
internal class DeviationConvert : IMultiValueConverter
|
||
|
|
{
|
||
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||
|
|
{
|
||
|
|
string a = System.Convert.ToString(values[0]);//转换数组1的信息
|
||
|
|
string b = System.Convert.ToString(values[1]);//转换数组2的信息
|
||
|
|
if (a != "" && b != "")
|
||
|
|
{
|
||
|
|
string c = (System.Convert.ToSingle(b) - System.Convert.ToSingle(a)).ToString("0.0");//计算值1和2的差值并返回字符串
|
||
|
|
//string c = "0";
|
||
|
|
return c;
|
||
|
|
}
|
||
|
|
return null;
|
||
|
|
}
|
||
|
|
|
||
|
|
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
|
||
|
|
{
|
||
|
|
throw new NotImplementedException();
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|