react-native .toLocaleString() 不适用于 android [英] react-native .toLocaleString() not working on android

查看:55
本文介绍了react-native .toLocaleString() 不适用于 android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 react-native 上使用 .toLocaleString() 来输出我的号码.全部适用于 IOS,但似乎不适用于 Android.这是正常的还是?我需要使用小数点函数吗?

I'm using .toLocaleString() on react-native for my number output. All work on IOS but seems not working on Android. This is normal or? Do I need to use a function for the decimal?

推荐答案

您可以使用

number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")

这篇关于react-native .toLocaleString() 不适用于 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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