Copy link to clipboard
Copied
Hello
So i have a calculated field in my PDF which is a ratio of 2 other fields in the PDF.
eg.
Final List Price (sa11) = 300
Sale Price (s1) = 100
Final List to Sale Ratio = (s1/sa11)*100
In the Ratio field properties i have selected the 'Cutom' format option and put in the following script to avoid showing 'NaN' and Infinity since the user would not have filled in the fields yet.
Format Tab -- Custom Format Script
if (event.value == "NaN" || event.value == Infinity) {event.value = "";}
In the Calculate tab i put in the following formula in the 'Simplified Field Notation' area
-- Simplified FIeld notation on the Calculate tab
(s1/sa11)*100
My problem is HOW DO I ROUND THE final calculated RATIO to 2 decimals. I tried many things but nothing is working. I am new this and am sure i am doing something wrong.
Have attached pictures below
Copy link to clipboard
Copied
As the custom Validation script enter the following code:
if (event.value) event.value = event.value.toFixed(2);
Copy link to clipboard
Copied
As the custom Validation script enter the following code:
if (event.value) event.value = event.value.toFixed(2);
Copy link to clipboard
Copied
try67! many thanks that worked.
Copy link to clipboard
Copied
try67! or anyone that may be able to help. I am new to Adobe, calculation script, java script, pretty much everything.
I am trying to make a form that has has to do the following:
1. A drop down box with different selections (i.e. A-1 thru A-107)
2. Once a selection is made, I need to be able to select options to appear under the first selection.
i.e. Select A-2, then has 9 sub boxes that can be checked.
3. Once the selection is made, only the selected item(s) will show in the box.
Please assist. thanks.
Gordon
Copy link to clipboard
Copied
This has been discussed many times in the past, and full code samples have been given.
If you want to do it yourself try searching for similar questions, and also read these tutorials:
https://acrobatusers.com/tutorials/conditional-execution
https://acrobatusers.com/tutorials/change_another_field
https://acrobatusers.com/tutorials/show_hide_fields
https://acrobatusers.com/tutorials/js_list_combo_livecycle
https://acrobatusers.com/tutorials/list_and_combo_in_lc
If you're interested, I've developed some similar scripts in the past and could write for you the custom code needed to do what you're after, for a fee. You can contact me privately (via PM) to discuss it further.