4 Replies Latest reply on Dec 5, 2017 5:41 PM by chloeh74927183

    How do I get my form calculation to round to 2 decimal places?

    chloeh74927183

      Hi,

       

      I need my total value amount in my form to display two decimal places. At the moment it shows as .00 no matter what numbers I put in.

       

      The script I am using is this:

       

      (function () { 

       

          // Get the field values, as numbers 

          var v1 = +getField("ccc").value; 

          var v2 = +getField("ddd").value;

       

          if (v1 !== 0) { 

              event.value = v1 * v2 * 220; 

          } else { 

              event.value = ""; 

          } 

       

      })();

       

      Please help! Thanks in advance.