The commonly used method, js toLocaleString() method, converts to the thousandths of a number

Values ​​such as the amount of money are often added to the thousandths, so hereby record it

1. The data returned by the backend

<b>{
   
   { list.amount }}</b> 元 //212230.12

2. Use toLocaleString to convert the thousandth place. The value must be of the Number type. If the returned string is a string, remember to turn it

<b>{
   
   { Number(list.amount).toLocaleString() }}</b> 元

Effect

Guess you like

Origin blog.csdn.net/m0_59023970/article/details/124120642