5 Replies Latest reply on May 10, 2013 11:16 AM by crystaltroiano

    Rounding Up

    crystaltroiano

      I have a script that I am working in and need a little help getting the answer to round up to the next $0.10. I am not sure if I can do this action in the script I currently have or if I need to make a new one. If so can I call two functions in the Calculations tab?

       

      Here is the script I currently have. Everything in this script is currently working the way I want it to, just the last line is my attempt to get it to round - which is not working. Thanks in advance!

       

      function getLEDLighting() {
      var kwh = this.getField("LED kWh SavingsRow01").value;
      var projCost = this.getField("LED Measure CostRow01").value;
      var opHours = this.getField("LED Annual Operating HoursRow01").value;

      if (kwh == "" || opHours == "" ||  projCost == "") {
        event.value = "";
      }
      else if (projCost/2 < kwh * .10)
      {
        event.value = projCost/2;
           }
      else {
                event.value = kwh * .10;
                event.value = Roundup(this.getField("LED SubtotalRow01")).value;

      }
      }