search

Home  >  Q&A  >  body text

javascript - js decimal to hexadecimal

JS decimal to hexadecimal conversion failed, I want to convert the result of sim1 to hexadecimal

淡淡烟草味淡淡烟草味2793 days ago746

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-05-19 10:25:57

    You can use the tostring method of numbers, and the parameter is the base to be converted

    var a = 16;
    a.toString(16)// 结果为'10'

    reply
    0
  • Cancelreply