【发布时间】:2021-09-16 13:01:34
【问题描述】:
使用角度 我的组件中有这个
export class AppComponent {
currency = 'EUR';
amount = 312.562;
我想在我的模板中以这种格式显示我的金额和我的货币
312.562 -> €000,000,312.562
我已经试过了:
{{ amount | number: '9.2' | currency: this.currency }}
但我有这个错误
Error: InvalidPipeArgument: '000,000,312.562 is not a number' for pipe 'CurrencyPipe'
那么,我怎样才能在不将其视为有效数字的情况下添加货币符号呢?
建议?
【问题讨论】:
标签: angular typescript angular-template angular-pipe