diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js index 9cb6d7cb26..572c00dc70 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-create.js @@ -84,8 +84,17 @@ define(function(require) { } function _totalCost(){ - var total = document.getElementById('real_memory_cost').value + document.getElementById('real_cpu_cost').value; - document.getElementById('total_cost').textContent = "Total: "+ convertCostNumber(total); + var memory = document.getElementById('real_memory_cost').value; + var cpu = document.getElementById('real_cpu_cost').value; + if(memory === undefined && cpu === undefined){ + document.getElementById('total_cost').textContent = "Total: 0.00"; + } else if(memory === undefined){ + document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(cpu); + } else if(cpu === undefined){ + document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory); + } else { + document.getElementById('total_cost').textContent = "Total: " + convertCostNumber(memory + cpu); + } } function _calculatedRealMemory(){ diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs index 48098a1d73..4781ed4e99 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/html.hbs @@ -119,7 +119,7 @@ {{tr "Cost"}} - 0.00 + {{tr "COST"}} / {{tr "MONTH"}}