Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!