I currently have a table with three columns - List Price, Discount and Buy Price. The aim of the form is to have a list price and if a discount on the list price needs to be shown, you just enter in the discount and the buy price is automatically calculated to show list price less the discount percentage.
In both List Price and Buy Price I selected the Number format and in Discount I selected the Percentage Format.
At the moment to change the percentage amount I have to type .50 for 50% instead of just putting in 50 but I've been browsing through the forums and changed the custom format script to
if (event.value != "") {
event.value = event.value + "%"
}
My current Buy Price calculation is as follows;
// total purchase
var a = this.getField("ListPrice16").value;
// discount rate of total purchase
var b = this.getField("Discount12").value;
// compute discount amount
var fDiscount = a * b;
// compute total puchase less discount, net purchase price
event.value = a - fDiscount;
What is the correct code to use so that I can keep my nicely formatted percentage table as well as correct Buy Price calculations?
var fDiscount = a * b;
to this:
var fDiscount = a * (b/100);
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com