Open vchikalkin opened 4 years ago
@djChika Did you find any solution for this?
Same error, located on ./node_modules/react-native-amount-input/AmountInput.js
, probably at line 22:
const formatter = new Intl.NumberFormat('en-US, {
style: 'currecy',
currency: currency || 'USD',
});
return formatter.format(0)[0];
Intl seems to be a built in, are you using TS?
probably adding "lib": ["es6"],
to tsconfig
may fix this for you.
On the other hand, the lib could be using toLocaleString
instead of Intl
:
(0).toLocaleString('en-US', { style: 'currency', currency: currency || 'USD' })
Edit: nop, on android I get the same Intl error, this seems to be a issue with hermes not supporting Intl
, also, using toLocaleString on android returns a default string, not a formatted one (because Intl is not present there)
@janaka120 @Gabrielhvcardoso @Grohden
I switched to react-native-masked-text
@djChika tried that but had some problems (zeroes added at end are ignored/removed).
Been using a personal solution - for my specific use case - if anyone's interested: https://gist.github.com/Grohden/23984bf94ec2f3a8a9b2a51254b68ee5
@djChika tried that but had some problems (zeroes added at end are ignored/removed).
Been using a personal solution - for my specific use case - if anyone's interested: https://gist.github.com/Grohden/23984bf94ec2f3a8a9b2a51254b68ee5
It sounds good, thanks man!
I've found some a pure javascript solution that have been so usefull to format currencies, I'll provide this snack if someone has interest.
I switched to react-native-masked-text, too