Math without type

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Hi all,

I have a situation where I have two objects, and if they are both any
kind of numeric, I need to perform some opration on them (such as
multiple or divide).

I'd like to do so without a huge case statement. Any ideas on how to
easily do this?

Thanks
Andy
 
Always work on Decimal values and convert everything to a Decimal before
operating on it?
 
Andy said:
I have a situation where I have two objects, and if they are both any
kind of numeric, I need to perform some opration on them (such as
multiple or divide).

I'd like to do so without a huge case statement. Any ideas on how to
easily do this?

Not possible.

Arne
 
Thanks Peter,

That is what I ended up doing. I then look at the typecode of the
first operand and use decmial.ToXXX methods to convert to the next
type. Seems to fit my requirements.

Andy
 
Back
Top