我使用react-intl来格式化基于区域设置的数字。
react-intl
对于cs语言环境,this.props.intl.formatNumber(-0.0001)返回-0。我希望库返回-0,0001。所以,我不想舍入数字。
cs
this.props.intl.formatNumber(-0.0001)
-0
-0,0001
我如何才能做到这一点。
发布于 2020-08-10 06:11:13
您需要指定minimumFractionDigits:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat
minimumFractionDigits
https://stackoverflow.com/questions/61078834
相似问题