js convert a conventional digital format to form the output thousandth

123456789 NUM = var; 
1. thousandths formatted output num.toLocaleString () 
// "123,456,789" 
2. formatted with the $ symbol output thousandths 
num.toLocaleString ( "en-US", {style: " Currency ", Currency:" USD "}) 
//"$123,456,789.00" 
3. ¥ symbol formatted with output 
num.toLocaleString ( "zh-Hans-CN ", {style: "currency", currency: "CNY"}) 
//"¥123,456,789.00 "

  

Guess you like

Origin www.cnblogs.com/zgdawdl/p/11447422.html