应用场景:
把1、2、3,转为一、二、三
方法:
retBigSrt(num) {
const changeNum = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
const unit = ['', '十', '百']
num = parseInt(num)
const getWan = (temp) => {
const strArr = temp.toString().split('').reverse()
let newNum = ''
for (var i = 0; i < strArr.length; i++) {
newNum = (i === 0 && strArr[i] === 0 ? '' : (i > 0 && strArr[i] === 0 && strArr[i - 1] === 0 ? '' : changeNum[strArr[i]] + (strArr[i] === 0 ? unit[0] : unit[i]))) + newNum
}
return newNum
}
const overWan = Math.floor(num / 100)
let noWan = num % 100
if (noWan.toString().length < 2) noWan = '0' + noWan
return overWan ? getWan(overWan) + '百' + getWan(noWan) : getWan(num)
},
使用:

或者在方法中调用此方法




![[每天一道面试题] HTTP,FTP,TFTP的底层实现协议是什么](https://img-blog.csdnimg.cn/direct/a9bf275e7b40469e9cf6eba7ff5f4a1c.png)













![[图像处理] MFC载入图片并绘制ROI矩形](https://img-blog.csdnimg.cn/direct/c7c34f185b1642e8a1cb3b56e1113893.png)
