1
I need to sum the values stored in a variable in the bank.
I have a form and want to know the total value generated in a variable.
So I did it this way:
_.each(cliente.data, function (data) {
for(i=0; i>=cliente.data.length; i++){
var valor= data.valor;
}
});
While i >= visit.oppEY.length(my vector) should add the values accumulated in the value variable.
But I have tried in many ways and the only thing that happens is the increase of values.
I get it. But the problem of this model you made is the same as mine. It doesn’t add up, it just adds up the values. It looked like this: I had a value of 90,000 and another of 300.00 = 090.000300.00. This was the result, it did not add up.
– Nodejs
@Nodejs ah yes, I was going to comment on that. Try
valor+= Number(data.valor);
.– DontVoteMeDown
Perfect. It worked. Thank you so much !
– Nodejs
@Nodejs ok, you’re welcome.
– DontVoteMeDown