숫자를 형식화하고 각도로 복수화하고 싶습니다. 나는 무엇을 시도했다angularjs에서 숫자를 복수화하고 형식을 지정하는 방법
0 => "John has no bitcoins"
1 => "John has 1 bitcoin"
2 => "John has 2 bitcoins"
12345.6789 => "John has 12,345.67 bitcoins"
:
(bitcoins의 번호 부여) 예를 들어John has
<ng-pluralize count="bitcoin_amount | round:2"
when="{'0': 'no bitcoins',
'1': '1 bitcoin',
'other': '{} bitcoins'}">
</ng-pluralize>
하지만이 때문에 숫자와 동일 또는 1000보다 더 들어 비참하게 실패, 그들이있다 count
특성에 1,000
으로 전달되므로 수천 개만 표시됩니다. 예 : 예는 this demo의 상자 number of people
에 1,000
을 붙여
1001 => 1
1000 => 1
2000 => 2
etc...
보십시오.
어떻게 번호를 배열하고 복수로 복수화 할 수 있습니까?