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

116
Vistas
Can someone please assit me with the output of this function
<html>
<script>
function zero ( zeroArray ){
        console.log('ZERO ARRAY ' + zeroArray)
        if(zeroArray !== undefined){
            let fixed = parseInt(zeroArray).toFixed(1)
            console.log('REPLACE '+ fixed.replace(".", ""))
            return fixed.replace(".", "")
        }
        return zeroArray
    }
    </script>
</html>
  • the function appends a 0 when there is an undefined number after the input ie 4 will return 40
  • say the input is 4.4, it needs to return 44 and at the moment it returns 40, or say 3.5 should return 35 which returns 30
  • thanks for any help provided
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

parseInt, rounds it to an integer. Use parseFloat.

Example

parseFloat('10.5').toFixed(1).replace('.','');  // output "105"
about 4 years ago · Juan Pablo Isaza Denunciar

0

function zero(zeroArray) {
    if (zeroArray !== undefined) {
        let fixed = zeroArray * 10;
        return fixed;
    }
}
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