Home > DeveloperSection > Interviews > How do you convert numbers between different bases in JavaScript?

Posted on    August-01-2012 2:12 AM

 JavaScript
Ratings:
 1 Answer(s)
  2074  View(s)
Rate this:

AVADHESH PATEL

Total Post:257

Points:1285
Posted on    August-01-2012 12:00 AM

Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);

Don't want to miss updates? Please click the below button!

Follow MindStick