Make simple percentage calcuation in fillable form

This Forum is for the use of End Users requiring help and assistance for Tracker Software's PDF-Tools.

Moderators: Daniel - PDF-XChange, PDF-XChange Support, Vasyl - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Stefan - PDF-XChange

Post Reply
alpinemultiview
User
Posts: 3
Joined: Mon Feb 27, 2023 10:55 am

Make simple percentage calcuation in fillable form

Post by alpinemultiview »

Hello,

I want to make a PDF and have a fillable field where the user enters a number and a percentage. And the output should be the percentage of that number.

EX: NUMBER: 100
PERCENTAGE 70

OUTPUT=70


The problem with the standard PDF-Xchange percentage is that the user needs to fill in "0.7" instead of 70 for the percentage.

Maybe a simple javascript? Number*(percentage/100). But i dont know how to get the javascript to work or how to type it properly?

Thank you...
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19745
Joined: Mon Jan 12, 2009 8:07 am
Contact:

Re: Make simple percentage calcuation in fillable form

Post by Stefan - PDF-XChange »

Hello alpinemultiview,

Please find attached a sample of what I believe is your desired calculation.

The third field is calculated indeed with a relatively simple formula:

Code: Select all

this.getField("Text3").value=this.getField("Text1").value * this.getField("Text2").value / 100
Kind regards,
Stefan
Attachments
Field_with_percentage_as_non_decimal_value.pdf
(6.92 KiB) Downloaded 10 times
alpinemultiview
User
Posts: 3
Joined: Mon Feb 27, 2023 10:55 am

Re: Make simple percentage calcuation in fillable form

Post by alpinemultiview »

Worked perfectly. Thank you for quick and good help! :D
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 10727
Joined: Wed Jan 03, 2018 6:52 pm

Make simple percentage calcuation in fillable form

Post by Daniel - PDF-XChange »

:)
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Post Reply