1
我想在另一個國家/地區更改Numeral.js中的貨幣格式。怎麼做?如何使用Numeral.js中的locale作爲react-native?
我想在另一個國家/地區更改Numeral.js中的貨幣格式。怎麼做?如何使用Numeral.js中的locale作爲react-native?
你是否設法解決這個問題?
我需要與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
它的工作原理部分。您需要設置一個掩碼,如下所示:Numeral(100).format(「$#,## 0.00」); –
我還沒有解決我的問題,在我問這裏一週後,服務數據的人將其更改爲固定值(以完整格式返回),因此我不再使用Numeral.js。這個答案效果很好嗎?考慮接受這個.. – fufu