angular.js - 欧洲符号十进制数 [英] angular.js - decimal numbers in European notation
问题描述
在角可以用货币过滤器格式的数字,像这样的:
In Angular you can use the currency filter to format a number, like like this:
{{service.price | currency: "€ "}}
标准输出为
€ #,##0.00
如何才能输出是:
How can the output be:
€ #.##0,00
(欧洲符号)
推荐答案
角支持国际化
标准位置|全球化|国际化。当谈到格式角数依赖于 $区域
服务和更具体的财产 NUMBER_FORMATS
。
Angular supports i18n
Standard for location | globalization | internationalization. When it comes to number formatting Angular relies on $locale
service and more specifically on the property NUMBER_FORMATS
.
本身的货币符号不会更改编号格式,除非你改变了位置。
The currency symbol by itself will not change the numbering formatting unless you change the 'location'.
下面是位置列表中目前支持的角度:
Here is the list of locations currently supported by angular:
http://cdnjs.com/libraries/angular-i18n/
下面是关于如何支持德语区域:
<html ng-app>
<head>
<script src="angular.js"></script>
<script src="i18n/angular-locale_de-de.js"></script>
</head>
</html>
如果你想挖掘更多到它,你可以在任何上面提供的的CDN的搜索 NUMBER_FORMATS
,你会发现会用什么角度来格式化你的号码,这有一个例子:
If you want to dig more into it you can search for NUMBER_FORMATS
in any of the CDNs provided above and you will find what angular will use to format your numbers, this is an example:
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": ".",
...
这篇关于angular.js - 欧洲符号十进制数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!