Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

117
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda