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

231
Visualizações
How to convert a value from a range input field to currency format

I am trying to convert the output of the range from the input field to a Currency Format in Js. The Numbers are displaying correctly but I will like to convert it to Number Format on the output

const slider = document.getElementById("idc");
const value = document.getElementById("idk");
value.textContent = slider.value;
slider.oninput = function() {
  value.textContent = this.value;
}
<input type="range" name="range" min="0" max="5000000" id="idc" step="1000" value="0">
<h4>$</h4>
<h4 id="idk">0</h4>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Does this work for you?

const slider = document.getElementById("idc");
const value = document.getElementById("idk");
value.textContent = slider.value;
slider.oninput = function() {
  value.textContent = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(this.value);
}
<input type="range" name="range" min="0" max="5000000" id="idc" step="1000" value="0">
<h4>$</h4>
<h4 id="idk">0</h4>

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