如何在 react-native 中使用来自 Numeral.js 的语言环境?

How to use locale from Numeral.js in react-native?

我想更改 Numeral.js 中与另一个国家/地区的货币格式。怎么做?

你设法解决了那个问题吗?

我需要与 pt-br 一起使用,我做到了:

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

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

//Usage
Numeral(100).format("[=10=].00")
// output R0,00

您可以执行以下操作;

//导入

import Numeral from "numeral";

//使用

numeral("10").value()

Numeral.js v. 2.0.6

import numeral from 'numeraljs';

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