Skip to main content
cataholic_1
Known Participant
December 8, 2020
Answered

Calculated field adds a negative number instead of subtracting it

  • December 8, 2020
  • 7 replies
  • 3465 views

I have a purchase order form that I created, with calculated fields to take the quantity times the price to get an extended amount. I then have a calculated subtotal field at the bottom that sums all of the extended quantities. For the subtotal field, I selected the "Value is the sum of the following fields".

However, if there is a credit line and I enter a negative number, it adds the amount instead of subtracts it. If I take the minus sign out, then it subtracts it.

I'm sure I'm missing something really simple here, but I'd appreciate it if someone could help me out. Do I need to do an If/Then statement? What would that look like?

Thanks.

 

Lisa

 

 

This topic has been closed for replies.
Correct answer Nesa Nurani

You have a problam with delay probably, so check field calculation order. While in prepare form click on "More" "Field calculation order" and check your fields order.

7 replies

cataholic_1
Known Participant
December 8, 2020

Thanks Nesa!

That was the problem. Once I changed the calculation order, the calculations work.

Thom Parker
Community Expert
Community Expert
December 8, 2020

That was one of the first suggestions you received. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
cataholic_1
Known Participant
December 8, 2020

Oh, I didn't even see that answer. Sorry about that.

cataholic_1
Known Participant
December 8, 2020
Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
December 8, 2020

You have a problam with delay probably, so check field calculation order. While in prepare form click on "More" "Field calculation order" and check your fields order.

cataholic_1
Known Participant
December 8, 2020

I enter a negative number under Unit Price, which adds it to the subtotal.

Then, if I take the minus sign out, it subtracts the amount from the subtotal.

I've also noticed that the total is not calculating correctly. The formula is adding the Subtotal + HST.

 

Bernd Alheit
Community Expert
Community Expert
December 8, 2020

Change the field calculation order.

cataholic_1
Known Participant
December 8, 2020

Sorry, I missed this answer altogether. This worked. Thank you very much!

try67
Community Expert
Community Expert
December 8, 2020

Adding a negative number and subtracting a positive number is the same thing...

cataholic_1
Known Participant
December 8, 2020

I'd like to show a negative number and have it subtract from the total.

Inspiring
December 8, 2020

In math minus and minus will give plus, but if you using sum and enter minus it should substract.Is your field format as number? Where are you entering credit line?

cataholic_1
Known Participant
December 8, 2020

Field format is number with 2 decimal places.

 

Bernd Alheit
Community Expert
Community Expert
December 8, 2020

Where does your enter the negative number?