React native 如何在react native中使用numeric.js中的locale?

React native 如何在react native中使用numeric.js中的locale?,react-native,numeral.js,React Native,Numeral.js,我想与其他国家/地区更改numeric.js中的货币格式。怎么做?你解决了那个问题吗 我需要使用pt br,我做到了: import Numeral from "numeral"; import "numeral/locales/pt-br"; // switch between locales Numeral.locale('pt-br'); //Usage Numeral(100).format("$0.00") // output R$100,00 您可以执行以下操作: //进口 i

我想与其他国家/地区更改numeric.js中的货币格式。怎么做?

你解决了那个问题吗

我需要使用pt br,我做到了:

import Numeral from "numeral";
import "numeral/locales/pt-br";

// switch between locales
Numeral.locale('pt-br');

//Usage
Numeral(100).format("$0.00")
// output R$100,00

您可以执行以下操作:

//进口

import Numeral from "numeral";
//使用

数字。2.0.6

import numeral from 'numeraljs';

<Typography>$ {numeral(3000).format('0,0')} pesos</Typography>

它部分起作用。您需要设置一个掩码,如下所示:number100.format$,0.00;我还没有解决我的问题,提供数据的人在我询问这里一周后将其更改为固定值并以完整格式返回,因此我不再使用digital.js。这个答案有效吗?考虑接受这个。。
import numeral from 'numeraljs';

<Typography>$ {numeral(3000).format('0,0')} pesos</Typography>