每三位负数和正数加逗号

Add comma to negative and positive numbers every three digits

如何通过 jQuery 使用每三位逗号分隔符来格式化正数和负数? 我在网上冲浪,但所有的答案都是正数。 谢谢。

查看 Number.prototype.toLocaleString()

console.log((2000000).toLocaleString())
console.log((-2000000).toLocaleString())