Copy link to clipboard
Copied
Hello
I have an expense report that is driving me crazy.
Travel Expense Area specifically.
e.g.
Step 1 - MilesRow 1 is number of miles manually entered'
Step 2- MCost1 is the product of MilesRow1 x 0.655 (current rate)
I have twelve lines.
Step 3- MilesTOTALMILEAGE is sum of all MilesRow lines 1-12
Step 4- Mileage Cost Total is sum of all MCOST rows 1-12. (This is the one not working)
The numbers add up across, but do not calculate properly in the final Mileage Cost Total
Attached is the form. As you can see. with the numbers I plugged in. It should be $24.25 not $24.24. This wreaks havoc wth accounting. All are formatted to 2 decimals. All are calculated using simplified notations or Value is the sum of...
HELP!
Copy link to clipboard
Copied
Correction I put in 1 mile in each area and it should add up to .665 x 3= 1.98 but it shows 1.97
Copy link to clipboard
Copied
You need to fix the fields calculation order. The totals should appear at the bottom of the list.
Copy link to clipboard
Copied
Thanks but i did that and didnt change anything
Copy link to clipboard
Copied
The issue with the rounding is that the numbers you're seeing are not the actual field values (because of the Format options you selected). If you click the Cost fields you'll see that they change from 0.65 to 0.655. The latter is the actual value. If you want to round them you need to use a script. So, for example, for the first field use this code:
event.value = (Number(this.getField("MilesRow1").valueAsString) * 0.655).toFixed(2);
Do that to all the fields and their display values will match their actual ones. You should also remove the Format setting, so the real value is no longer hidden.
Copy link to clipboard
Copied
Thank you! The script work. I appreciate your input. My accounting dept thanks you!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more