Using .toLocaleString() in Node.js

前端 未结 4 1758
被撕碎了的回忆
被撕碎了的回忆 2020-12-15 04:14

So I was writing a small helper method to convert numbers into a valid money format ($xx,xxx.xx) using .toLocaleString(). Everything works as expe

4条回答
  •  猫巷女王i
    2020-12-15 05:12

    Based on this issue it appears that it was decided that shipping node.js with internationalization would make it too large. You can npm install intl and require that, and it will replace toLocaleString with a version that works.

提交回复
热议问题