如何将 Intl.NumberFormat 与 react native 一起使用? [英] How to use Intl.NumberFormat with react native?
问题描述
我正在尝试在 React Native 中将数字转换为价格格式.如何使用 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat (Intl.NumberFormat) this with react native?
Im trying to convert a number to price format in react native. How to use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat (Intl.NumberFormat) this with react native?
推荐答案
看来你需要 JSC 的国际版:安卓:https://github.com/react-native-社区/jsc-android-buildscripts#international-variant
Looks like you need the international version of JSC: Android: https://github.com/react-native-community/jsc-android-buildscripts#international-variant
对于 iOS,你需要使用 Intl.js polyfill https://github.com/andyearnshaw/Intl.js/
For iOS you'd need to use Intl.js polyfill https://github.com/andyearnshaw/Intl.js/
这篇关于如何将 Intl.NumberFormat 与 react native 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!