These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Script calc help with Dividing

cjbscoffee
Registered: Apr 2 2009
Posts: 8

Field1/(Field2 * 231) * Field3

My caluculations work when I enter my number's in the preview. I just keep geting the
arithmatic over/underflow error and not sure how to fix it.

My Product Information:
LiveCycle Designer
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Maybe your calculation causes a to large number of decimal places.

Try...

Round(Field1/(Field2 * 231) * Field3, 2)

Also ensure there is no zero value in the calculation, this can also cause an arithmatic over/underflow error .

If you expect zero values use an if expression for the calculation like...

var SUM1 = Field1 .rawValue
var SUM2 = Field2 .rawValue
var SUM3 = Field3 .rawValue

if (SUM1 > 0) then
Round(SUM1/(SUM2 * 231) * SUM3, 2)
endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You need for Field2 having a value and not being equal to zero.

if (HasValue(Field2) and Field2 <>0) thenField1 / (Field2 * 231) * Field3elsenullendif

George Kaiser

cjbscoffee
Registered: Apr 2 2009
Posts: 8
Thanks both of these examples worked for me and I no longer get the error and my calculation works wonderful.