Skip to main content
Paul@40
Known Participant
July 30, 2023
Answered

PDF form presenting incorrect value in Total

  • July 30, 2023
  • 1 reply
  • 2153 views

I have made a simple invoice form that calculates the following

 

Weekly Fee is divided by 7 days = Daily Fee. Then Daily Fee is multiplied by the Billable Days to produce the Total.

 

In the example I am using the Weekly Fee = 692.71 which divided by 7 produces the Daily Fee = 98.96.

 

The amount of Billable Days is 31. Multiplying 31 x 98.86 should produce the Total = 3,067.76.

 

The problem I have is that the calculation in the form is showing as 3,067.72.

 

I believe this may be due to the calculation not rounding up or down correctly and I believe I may need some Javascript to adjust this-  but I have no idea how to achieve that.

 

If anyone can kindly assist with this it would be greatly appreciated. Thank you 🙂

This topic has been closed for replies.
Correct answer try67

Sure here it is


Here you go...

1 reply

try67
Community Expert
Community Expert
July 30, 2023

That's because 692.71 divided by 7 is not 98.96. It's 98.95857142857143, and when you multiply that by 31 you get 3067.7157142857145. If you want to get the results you've specified you need to actually round the numbers up or down. If you only do so using the Format setting of a Number field they would appear rounded, but won't actually be so. For actual rounding you need to use a script.

Paul@40
Paul@40Author
Known Participant
July 30, 2023

Hi

 

Thank you for your response. That is what I suspected as I used a calculator to check and got the result you indicated.

 

However I am not sure what is it is you are suggesting that I do? This is the first form I have ever made using calculations.

 

How do I round it up or down? I have used the Format to display only 2 decimal points but if i switch that off and allow it to show all decimal places it still doesn't show the right total.

 

Apologies if I am being stupid 😉