Hi,
In invoice i have 2 fields named as qty and price
i have stored these variables in one array
total number should not 2 decimals
Ex:123.12(I need like this)
123.123(I don't need)
Could kindly any one help me
Here my sample code
Sum of ng repeat elements
..........................
$scope.total = function(){
var total = 0;
angular.forEach($scope.invoice.items, function(item){
total += item.qty * item.price;
})
return total;
}
});
Piyush PansuriyaPosted Jan 2, 2019, 12:22 AM
Mahesh ReddyPosted Jan 2, 2019, 3:14 AM
Muthu KumarPosted Jan 2, 2019, 3:09 AM
For more reference.
https://stackoverflow.com/questions/2221167/javascript-formatting-a-rounded-number-to-n-decimals
Mahesh ReddyPosted Jan 2, 2019, 1:46 AM
Sreekanth ReddyPosted Jan 2, 2019, 12:26 AM