This issue is related to the Javascript core used to trigger the native reaction in Android, and not to the native reaction itself. To overcome this, you will need to integrate the latest javascript core into your Android build or upgrade your own version to 0.59.
Details are documented in the Android Build UA repository .
Now for people who would like to format locale strings without having to integrate the entire javascript core, Javascript has an Internationalization API that allows you to format numbers in a language-sensitive format. Documentation is available on MDN.
This API is not available on Android and needs to be populated using Intl
Install the Intl library at the root of your project
yarn add intl
And then in the index file of your project (index.js) add the following code at the top of the file:
if(Platform.OS === 'android') { // only android needs polyfill require('intl'); // import intl object require('intl/locale-data/jsonp/en-IN'); // load the required locale details }
After completing the two steps above, you can get the locale string anywhere in your project using
new Intl.NumberFormat('en-IN', { style: 'currency', currency: 'INR' }).format(10000000);
If you need to format the number for another locale code, all the details of the locale code are available in intl/locale-data/jsonp/
. Just require the ones you need in your index.js file.
source share