标签:float tofixed ring turn pre bsp cti parse Fix
var separator=(num)=>{ if(!num){ return ‘0.00‘; }; let str = parseFloat(num).toFixed(2); return str && str .toString() .replace(/(\d)(?=(\d{3})+\.)/g, function($0, $1) { return $1 + ","; }); } separator(386485473.99) //"386,485,473.99"
标签:float tofixed ring turn pre bsp cti parse Fix
原文地址:https://www.cnblogs.com/caoruichun/p/9716308.html