Good evening
I'm having a problem adding values with ng-repeat
object 1
COMISSAO_CORRETOR: "5.0"
CPF_CONTRATO: "xxx.xxx.xxx-xx"
NUMERO_CONTRATO: "1234567"
VALOR_BRUTO: "70000.00"
VALOR_COMISSAO: "3500.00"
VALOR_LIQUIDO: "70000.00"
object 2
COMISSAO_CORRETOR: "5.0"
CPF_CONTRATO: "xxx-xxx-xxx-xx"
NUMERO_CONTRATO: "98765442"
VALOR_BRUTO: "10000.00"
VALOR_COMISSAO: "500.00"
VALOR_LIQUIDO: "10000.00"
I want to add VALO_COMISSAO
and I'm using the following function
FUNCTION
$scope.GetTotal = function () {
var total = 0;
for(var i = 0; i < $scope.relatorios.length; i++){
var relatorio = $scope.relatorios[i];
total += (relatorio.VALOR_COMISSAO);
}
return total;
}
But the total is being returned 03500.00500.00