Skip to main content
cynbee3162
Participant
July 8, 2019
Answered

Formula help: adding up mileage fields then multiplying by .58 cent reimbursement rate.

  • July 8, 2019
  • 1 reply
  • 2801 views

It woked - then when I saved .pdf it was lost when I reopened it.  Then it would only work in some fields an not others.  Now it won't work at all.

// Get first field value, as a number

var v1 = +getField("MileagemilesRow1").value;

// Get second field value, as a number

var v2 = +getField("MileagemilesRow2").value;

// Get third field value, as a number

var v3 = +getField("MileagemilesRow3").value;

// Get fourth field value, as a number

var v4 = +getField("MileagemilesRow4").value;

// Get first field value, as a number

var v5 = +getField("MileagemilesRow5").value;

// Calculate and set this field's value to the result

event.value = .58 * (v1 + v5);

This topic has been closed for replies.
Correct answer cynbee3162

Where is your problem?

(0.0 + 0.0) * 0.58 is 0.0


Thank you for all your help.  There was a duplicate formula in another cell (which I had inadvertently copied) that was causing the problem.  But you had easier formulas to use.  Thank you, again!!!

1 reply

Bernd Alheit
Community Expert
Community Expert
July 9, 2019

You can use the simplified field notation:

(MileagemilesRow1 + MileagemilesRow5) * 0.58

cynbee3162
Participant
July 9, 2019

Still can't get it to total?

Bernd Alheit
Community Expert
Community Expert
July 9, 2019

Where is your problem?

(0.0 + 0.0) * 0.58 is 0.0