> For the complete documentation index, see [llms.txt](https://mm.ricky.moe/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mm.ricky.moe/interview/inverview-record/tou-tiao-mian-jing/bi-shi/153812.7-zhuan-hua-153812.7.md).

# 153812.7 转化153,812.7

## 解法1

```javascript
function dealNum(num){
    if(typeof num !== 'number') throw "input is not number"
    
    return num.toLocaleString()
}
```

## 解法2

实现思路是将数字转换为字符数组，再循环整个数组， 每三位添加一个分隔逗号，最后再合并成字符串。
