var grandTotal;
angular.forEach($scope.gear, function(value, key) {
var rowTotal = value.amount * value.price;
console.log(rowTotal);
grandTotal += rowTotal;
});
console.log('grandTotal: '+grandTotal);
I have the above that I'm trying to get a grant total for, It seems to return NaN for my grandTotal
UPDATE:
var grandTotal = 0;
angular.forEach($scope.gear, function(value, key) {
var rowTotal = value.amount * value.price;
rowTotal = rowTotal.toFixed(1);
console.log(rowTotal);
grandTotal += rowTotal;
});
console.log('grandTotal: '+parseFloat(grandTotal));
this returns 