Change a positive number to negative 
Author Message
 Change a positive number to negative

Hello everyone,

I have using the following expression:

dblNegative = CDbl("-" & dblPositive)

to convert a positive number to a negative one.

Is there a more appropriate way to do this?

Matthew MacFarland



Tue, 26 Mar 2002 03:00:00 GMT  
 Change a positive number to negative
Matthew,

Just use
  dblNegative = -dblPositive

This will be quicker and more accurate than your expression.

Simon Lewis

Quote:

>Hello everyone,

>I have using the following expression:

>dblNegative = CDbl("-" & dblPositive)

>to convert a positive number to a negative one.

>Is there a more appropriate way to do this?

>Matthew MacFarland



Tue, 26 Mar 2002 03:00:00 GMT  
 Change a positive number to negative
Hello Simon,

Thanks for the reply. I am changing my code now.

Thanks
Matthew


Quote:
> Matthew,

> Just use
>   dblNegative = -dblPositive

> This will be quicker and more accurate than your expression.

> Simon Lewis


> >Hello everyone,

> >I have using the following expression:

> >dblNegative = CDbl("-" & dblPositive)

> >to convert a positive number to a negative one.

> >Is there a more appropriate way to do this?

> >Matthew MacFarland



Tue, 26 Mar 2002 03:00:00 GMT  
 Change a positive number to negative
???
dblNegative = - dblPositive
???

--
Peter van der Zwan
Managing Director
ITCS Co., Ltd.
Map Tha Phut,
Rayong,
Thailand
.

Quote:

>Hello everyone,

>I have using the following expression:

>dblNegative = CDbl("-" & dblPositive)

>to convert a positive number to a negative one.

>Is there a more appropriate way to do this?

>Matthew MacFarland



Wed, 27 Mar 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. negative or positive to positive

2. Convert Positive to Negative Number?

3. Making negative number positive

4. Invert from negative to positive

5. Converting negative to a positive

6. Convert negative to positive

7. convert a positive to negative value

8. Convert negative to positive

9. change text to negative number

10. How to request a WHOLE positive number?

11. Making nagative number positive

12. Can't convert strings to positive numbers

 

 
Powered by phpBB® Forum Software