Home >Web Front-end >JS Tutorial >Javascript regular expression implementation to add thousand separators to numbers_javascript skills
Recently, I saw an interview (written test) question on the Internet about using js to implement thousands separators for numbers, so I wrote a method using "regular replace" to implement it:
Supports positive and negative sign matching and decimal point distinction. If there are any errors, please point them out:-D
Attached is another netizen’s implementation method
The above is the entire content of this article, I hope you all like it.