我的github
let num = 255; // 要转换的数字
let hexNum = num.toString(16); // 调用toString()函数并传入参数16表示转换成十六进制
console.log(hexNum); // 输出结果为 "ff"

来源:百度AI

 参考:https://www.php.cn/faq/487736.html

posted on 2024-01-26 09:29  XiaoNiuFeiTian  阅读(10)  评论(0编辑  收藏  举报