Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
why addition of this two numbers in js gives a huge fraction part

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!