Revision 69e77651

View differences:

src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js
84 84
  }
85 85

  
86 86
  function _totalCost(){
87
    var total = document.getElementById('real_memory_cost').value + document.getElementById('real_cpu_cost').value;
88
    document.getElementById('total_cost').textContent = "Total: "+ convertCostNumber(total);
87
    var memory = document.getElementById('real_memory_cost').value;
88
    var cpu = document.getElementById('real_cpu_cost').value;
89
    if(memory === undefined && cpu === undefined){
90
      document.getElementById('total_cost').textContent = "Total: 0.00";
91
    } else if(memory === undefined){
92
      document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(cpu);
93
    } else if(cpu === undefined){
94
      document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory);
95
    } else {
96
      document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory + cpu);
97
    }
89 98
  }
90 99

  
91 100
  function _calculatedRealMemory(){
src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs
119 119
      <legend>
120 120
        {{tr "Cost"}}
121 121
        <span>
122
          <span id="total_cost">0.00</span>
122
          <span id="total_cost"></span>
123 123
          <small>{{tr "COST"}} / {{tr "MONTH"}}</small>
124 124
        </span>
125 125
      </legend>

Also available in: Unified diff