0

this in js

 a = 1195;
 b = 359.64;
 ab = a + b;
 console.log('a + b = ' + ab);

gives me this output

a + b = 1554.6399999999999

but normally it should give 1554.64

briefly , im setting up a paypal payment function, but in some cases it doesnt work, then i figured out that some prices dont add up to the correct amount , why does this happen and what's the solution. i tried rounding but that messes up the accuracy in other cases because in this example we shouldn't have to round the number at all.

feel free to share your toughts

0 Answers0