HOW DO YOU CONVERT NUMBERS BETWEEN DIFFERENT BASES IN JAVASCRIPT?

AVADHESH PATEL

Total Post:257

Points:1285
Posted by  AVADHESH PATEL
 2403  View(s)
Ratings:
Rate this:
  1. AVADHESH PATEL

    Post:257

    Points:1285
    How do you convert numbers between different bases in JavaScript?

    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);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!