设备上的 ionic2 货币格式损坏

ionic2 currency formatting broken on device

Ionic2 框架允许像 {{finalPremium | currency : 'eur' : true :'.2-2' }}.

一样格式化货币

但是,这似乎只在浏览器中有效。在设备上启动时 (iPhone) 我在日志中看不到任何错误,但显示格式化货币的页面不会显示。

编辑

在 android 设备上它工作得很好。

货币管道使用的网络 API 并非在所有浏览器中都可用,因此您应该通过添加 polyfill 或该管道的开发人员 (angular 2) 来修复它。

https://angular.io/docs/ts/latest/guide/pipes.html

The Date and Currency pipes need the ECMAScript Internationalization API. Safari and other older browsers don't support it. We can add support with a polyfill.

您可以使用 Intl.js polyfill.