0
Good night
I’m having a problem adding up 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’m trying to add the 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 like this 03500.00500.00
And if you remove double quotes from the commission value attribute?
– Giancarlo Abel Giulian