The issue was caused by the exchange rate's format being text format instead of number format. Apparently the way the users entered the exchange rate determined whether the calculation was correct or not. Thank you for your assistance!!]]>

I will modify the script. Thanks. I have already confirmed the calculation order is correct.

Our international offices have not updated Reader for quite some time but everyone in this office uses the same version (7.0).

]]>
A minor syntax error, the line that reads "if (f.value != "");" should not have a ";" at the end of the line.

I would have coded the calculation as follows:

var f = this.getField("excRate"); // get exchange rate

var g = this.getField ("Check_Amount"); // get check amount

event.value = ""; // clear field

if (Number(f.value) != 0) {

// divisor not zero

event.value = g.value / f.value; // compute exchange

}

var g = this.getField ("Check_Amount"); // get check amount

event.value = ""; // clear field

if (Number(f.value) != 0) {

// divisor not zero

event.value = g.value / f.value; // compute exchange

}

If there are other calculations on the form double check the calculation order.

have all of the versions of Acrbat/Reader updated?

Edited by gkaiseril - 12 Oct 2011 at 8:43pm]]>

Good observation. Still mysterious but I will keep that in mind. They did note that it appeared to them that their calculation was using an exchange rate of 32.000 which gives the same result I listed. So it may be the format of the field(s) that may account for the issue.

And, in answer to your question -- they are accessing the file from the intranet so it would be the same for all.

I will keep you updated.

]]>
I don't have a solution but I observe that

190,437 / 32.1100 = 5,951.16 (rounded to two places).

Perhaps there is a clue here.

Are the users accessing the same file e.g. from an intranet site, or do they each have a copy which should be identical?

]]>
Yes, sorry -- cut and paste error on my part. The correct amount is 5,930.78 (rounded).]]>

Isn't the right answer 5,930.7848 ?]]>

I have several users in an international office who get different results with a JavaScript calculation in a form. I have checked their preferences in Reader 7.0 and they are the same as the users who get the correct result.

Here's my script:

var f = this.getField("excRate");

var g = this.getField ("Check_Amount");

if (f.value != "");

event.value = (g.value / f.value);

var g = this.getField ("Check_Amount");

if (f.value != "");

event.value = (g.value / f.value);

Using the following -- Amount: 190,437.50 and Rate: 32.1100, the users with the issue get 5,951.16 and the other users get the correct result of 5,951.78.

Any idea what could be causing this?

]]>