SOURCE


function dealFloatData(num){
    let formatNum = num.toFixed(2).replace(/\B(?=(\d{3})+\b)/g, ",").replace(/^/, "$$ ");
    console.log(formatNum)
}

dealFloatData(1123.123)
console 命令行工具 X clear

                    
>
console