2 Replies Latest reply on May 20, 2011 7:14 AM by 3Ingenuity

    How do I output a calculation as either blank or two decimal places?

    3Ingenuity

      I found how an answer to changing the format to custom and converting the calculation from 0.00 to blank by using the following

       

      if (event.value == 0) event.value = "";

       

      This is perfect for the 0.00 case.

       

      However, if the calculated value is 8.50 - the output is 8.5 in the form.  (just like when I said the format category was a number with 2 decimal places).

       

      What I need is the java script for the else part of the if statement

       

      else Output (event.value) with 2 decimal places

       

       

      I have searched and cannot find an answer.