我想格式化一个数字并用角度复数它。
例如(给定一些比特币):
0 => "John has no bitcoins"
1 => "John has 1 bitcoin"
2 => "John has 2 bitcoins"
12345.6789 => "John has 12,345.67 bitcoins"
我试过的:
John has
<ng-pluralize count="bitcoin_amount | round:2"
when="{'0': 'no bitcoins',
'1': '1 bitcoin',
'other': '{} bitcoins'}">
</ng-pluralize>
但这失败得很惨,因为对于等于或大于 1000 的数字,它们是1,000
在count
属性中传递的,所以只显示了数千。例如:
1001 => 1
1000 => 1
2000 => 2
etc...
尝试在此演示1,000
的框中粘贴示例。number of people
如何格式化数字并以 angular 复数形式?