Math without type

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
 
P

Peter Morris [Droopy eyes software]

Always work on Decimal values and convert everything to a Decimal before
operating on it?
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

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
 
A

Andy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top