5 Replies Latest reply on Apr 2, 2015 6:47 AM by philmodjunk

# Calculation to correct a double negitive

### Title

Calculation to correct a double negitive

### Post

Below is my calculation. If the in_amount is negative it doubles...

(in_amount = - 13.28) - (inpaidamount = 13.28) = - 26.53 not 0.

What is the best way to fix the calculation so it accommodates a negative amount?

If ( IN_isDLS ;

Round ( (IN_amount - INPaidAmount);2);

Round ( Invoice::INRemaining ; 2 )

)

• ###### 1. Re: Calculation to correct a double negitive

In terms of the mathematics, -13.28 - 13.28 SHOULD result in a value of -26.53, not zero.

-13.28 + 13.28 = 0
13.28 - 13.28 = 0

So if -25.53 is not the expected value, you need to figure out if the error is that the first term should not be negative or if you should not be subtracting the second term.

• ###### 2. Re: Calculation to correct a double negitive

99% of the values are positive... so Round ( (IN_amount - INPaidAmount);2); works.

in the 1% that are negative it does not.

What can i stick in the calculation that will accommodate the 1%?