Skip to main content
Participant
June 25, 2024
Answered

PDF ROUNDUP CALCULATION

  • June 25, 2024
  • 1 reply
  • 598 views

Please help a novice = ME!

I am multiplying 2 fields 'Entry1' and 'Entry2' and 'TOTALEntry1' should display the result. I formatted the NUMBER to 0 decimal so I could get the ROUND-UP number. 'Entry3' should be multiplied to 'TOTALEntry1' but picking up the true value of 'TOTALEntry1' which is 1 instead of 0.72.

This is what I want:

Entry1 (12) x Entry2 (6%) = TOTALEntry1 (1) x Entry3 ($6,005) = TOTALEntry2 ($6,005) 

This is what I am getting:

Entry1 (12) x Entry2 (6%) = TOTALEntry1 (0.72) x Entry3 ($6,005) = TOTALEntry2 ($4,323.60)

 

Please help.

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

You can use Math.round() to round the number, as Custom calculation script of "TotalEntry1" try this:

var e1 = Number(this.getField("Entry1").valueAsString);
var e2 = Number(this.getField("Entry2").valueAsString);

event.value = Math.round(e1*e2);

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
June 25, 2024

You can use Math.round() to round the number, as Custom calculation script of "TotalEntry1" try this:

var e1 = Number(this.getField("Entry1").valueAsString);
var e2 = Number(this.getField("Entry2").valueAsString);

event.value = Math.round(e1*e2);

Participant
June 25, 2024

It worked! That you very much. You're the best