Round to 2 decimal places
Could someone help me figure out how to round to 2 decimal places?
I've tried value= int((v2)*100/100; and other formulas that don't seem to be working.
I have managed to get the code to calculate as well as leave the box blank if mgkgpremed1 is blank by using the following in the format -> custome java script box:
var v1 = +this.getField("mgkgpremed1").value;
var v2 = +this.getField("mgpremed1").value;
if (v1==0) event.value="";
else event.value = kg*v1
And in the calculate section it has the product of kg*mgkgpremed1
Now I would also like v2 (or mgpremed1) to round to 2 decimal places. How do I do this? Would it go in the same format box?
