Copy link to clipboard
Copied
I created a form version of our business bank deposit slip to easily enter cash and check information. I then auto calculated totals from each column (1 being dollars and 2 being cents). The problem I am facing is I can't figure out a way to carry over the total from cents to dollars when the cents column is more than 0.99. Is there a formula within adobe to carry this number over and "reset" at 0.00 when passing a full dollar in the cents column?
Copy link to clipboard
Copied
The easiest way is to make one field per row, formated as a 2 decimal number, right justify the fields, and line them up so the decimal is on top of the black vertical line separating dollars and cents:
Copy link to clipboard
Copied
Remove both calculations from "TOTAL" and "TOTAL CENTS" field, then use this as 'Custom calculation script' of "TOTAL" field:
var cents = 0, dollars = 0;
for(var i = 1; i <= 28; i++) {
cents += Number(this.getField("Check Cents " + i).valueAsString) || 0;
dollars += Number(this.getField("Check $ " + i).valueAsString) || 0;}
dollars += Math.floor(cents / 100);
var Rcents = cents % 100;
if (Rcents < 10)
Rcents = "0" + Rcents;
event.value = dollars;
this.getField("TOTAL CENTS").value = Rcents;
Copy link to clipboard
Copied
Nice work.