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

381
Vistas
How to multiply decimals out of variable of type Number in TypeScript?

Lets say I have an number which is equal to 288.65 and I want to multiply out the decimal point to achieve the desired result of 28865

If I simply just try say console.log(288.65 * 100) it will return 28864.999999999996 I am not sure why it is doing this, any help will be much appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use Math.ceil and with Math.round

The Math.ceil() function always rounds a number up to the next largest integer.

The Math.round() function returns the value of a number rounded to the nearest integer.

const num = 288.65;

const result1 = Math.round(num * 100);
const result2 = Math.ceil(num * 100);

console.log(result1);
console.log(result2);

about 4 years ago · Juan Pablo Isaza Denunciar
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