I have the following numerical array:
var numberArray: number[] = [2.15, 0.72, 2.15, 0.72, 0.72];
where the sum of the values is 6.46. However, if I also run:
var Total = numberArray.reduce(function(a, b) {return a + b;});
I always get 6.459999999999999.
I have a numerical array with about 1000 values and when I try and get the total of these my numbers are way off and I think this is the reason. How can I get this to aggregate properly?