Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

118
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

function zero(zeroArray) {
    if (zeroArray !== undefined) {
        let fixed = zeroArray * 10;
        return fixed;
    }
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda