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

Decimals in Javasrcipt

millj23
Registered: Mar 11 2008
Posts: 2

Is there a way to limit the decimal points in this script?

Calculator

function CalculateSum(Atext, Btext, form)
{
var A = parseFloat(Atext);
var B = parseFloat(Btext);
form.Answer.value = A/(B*B);
}

Calculator

Text A:
Text B:

Answer =

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
This site is for Adobe's Acrobat and LiveCycle Designer produdts. In eitehr product you could use the Acrobat JavaScript "util.printf()" method to limit the number of decimal places displayed in the result field. This code is very specific to the Acrobat and LiveCycle Designer products and will not work on a web page.

George Kaiser