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

98
Visualizações
Scientific notation with javascript

I am developing a site with javascript, which does the following, the visitor will enter the unit quantity, the unit to compare and the unit of comparison (Ex: 12 centimeters for millimeter) and it will show how much the quantity of the unit to compare is equivalent to the unit of comparison, the only problem is that if I put a unit to compare too small and a unit to compare too large, it will happen that the result will be wrong (Ex: 17 decimeters for kilometers will give 0, 0170000000000001) so I asked a person and they replied that I should use scientific notation, but I have no idea how to do it in javascript, could anyone help me?

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Do you mean something like this?

number.toExponential(x)

x can go from 0 to 20. It's the number of digits after the decimal point.

about 4 years ago · Santiago Gelvez 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