I am using the following script. I want to calculate the value in the weight field x .01 and I want it to round up. So I want the Epinephrine dose to calculate based on the weight based on 0.1 mg per kilogram. (65 kg x 0.1). When it calculates, if I type 65.5 or 60.3 in the weight field, my end result is very long number i.e., .1555555. I just need a whole number like .16 or .15. Can someone help?
var wt = this.getField("fld.Weight")
var dse = this.getField("Sch.Epinephrine.Dose.mg.1")
if (wt.value == 0 || wt.value == "") {
dse.hidden = true}
else {
dse.hidden = false
dse.value = Math.round(((wt.value*.01)))}
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script