gpt4 book ai didi

Angular2 货币符号

转载 作者:太空狗 更新时间:2023-10-29 17:14:36 25 4
gpt4 key购买 nike

我在澳大利亚试图显示一些货币值(value),我正在做

{{ portfolio.currentValue | currency : 'AUD' : true : '4.0' }}

结果是 1,300,000 澳元,我想显示 1,300,000 美元(无 A),而不必更改为“美元”。

有没有办法自定义我的货币符号?

最佳答案

您可以将您的区域设置为澳大利亚,然后对于 AUD 货币,它只会显示一个 $。

在您的应用程序提供者中添加以下内容:

import { LOCALE_ID } from '@angular/core';
...
{ provide: LOCALE_ID, useValue: 'en-AU' }

然后下面将简单地显示一个 $ :

{{ portfolio.currentValue | currency : 'AUD' : true : '4.0' }}

关于Angular2 货币符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42058225/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com