E
Evgeny
Hi, all!
I have a litle question about comparing 2 values with different types, f.e
object Value1 = GetDecimalValue() - return decimal value = 1.
object Value2 = GetIntegerValue() - return integer value = 1.
bool res = Value1.Equals(Value2) - return false!!!
bool res2 = Value1 == Value2 - return false!!!
I understand, that a problem is definition Value1 and Value2 as object.
Should i write my function to change types of variables before comparing?
May be anybody knows a better way?
Thanks
Evgeny
I have a litle question about comparing 2 values with different types, f.e
object Value1 = GetDecimalValue() - return decimal value = 1.
object Value2 = GetIntegerValue() - return integer value = 1.
bool res = Value1.Equals(Value2) - return false!!!
bool res2 = Value1 == Value2 - return false!!!
I understand, that a problem is definition Value1 and Value2 as object.
Should i write my function to change types of variables before comparing?
May be anybody knows a better way?
Thanks
Evgeny