如何将 Intl.NumberFormat 与 react native 一起使用? [英] How to use Intl.NumberFormat with react native?

查看:75
本文介绍了如何将 Intl.NumberFormat 与 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆