简体   繁体   English

在 Angular-HTML 中使用 2 个管道

[英]Use 2 pipes in Angular- HTML

I use curreny pipe, but it add digits after dot.我使用货币 pipe,但它在点后添加数字。 How to remove them?如何删除它们?
The result of {{ 1111111 | | currency:'ILS' }} {{ 1111111 | | currency:'ILS' }}的结果{{ 1111111 | | currency:'ILS' }} {{ 1111111 | | currency:'ILS' }} is 1,111,111.00 . {{ 1111111 | | currency:'ILS' }}1,111,111.00 I want to remove the " .00 "我想删除“ .00

I tried to use both pipes, curreny and number: {{ 1111111 | number: '2.0' | currency:'ILS' }}我尝试同时使用管道、货币和数字: {{ 1111111 | number: '2.0' | currency:'ILS' }} {{ 1111111 | number: '2.0' | currency:'ILS' }} {{ 1111111 | number: '2.0' | currency:'ILS' }} but it don't give any result. {{ 1111111 | number: '2.0' | currency:'ILS' }}但它没有给出任何结果。

Try this尝试这个

{{ 1111111 | currency:'ILS': 'symbol':'1.0-0' }}

symbol will remove zero's.符号将删除零。

Please read the documentation is really explained in details.请阅读文档中的详细说明。 https://angular.io/api/common/CurrencyPipe https://angular.io/api/common/CurrencyPipe

Happy coding快乐编码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM