code: private Number calculateUnitsPercentComplete(Row row)
     {
        double result = 0;
  
        double actualWorkQuantity = NumberHelper.getDouble(row.getDouble("act_work_qty"));
        double actualEquipmentQuantity = NumberHelper.getDouble(row.getDouble("act_equip_qty"));
        double numerator = actualWorkQuantity + actualEquipmentQuantity;
  
        if (numerator != 0)
        {
           double remainingWorkQuantity = NumberHelper.getDouble(row.getDouble("remain_work_qty"));
           double remainingEquipmentQuantity = NumberHelper.getDouble(row.getDouble("remain_equip_qty"));
           double denominator = remainingWorkQuantity + actualWorkQuantity + remainingEquipmentQuantity + actualEquipmentQuantity;
           result = denominator == 0 ? 0 : ((numerator * 100) / denominator);
        }
  
        return NumberHelper.getDouble(result);
     }
docs: Calculate the units percent complete.
  
  @param row task data
  @return percent complete