A lightweight React Native library for formatting currency values as IDR (Indonesian Rupiah) and USD (US Dollar). Current stable version is 1.0.3, updated infrequently (last commit in 2019). Key differentiators: simple API, automatic rounding of IDR values to nearest integer, and configurable decimal/thousand separators. However, it lacks modern ESM support, TypeScript definitions, and active maintenance. Alternatives like 'react-native-currency-input' offer more features and active development.
npm install react-native-currency-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage of CurrencyFormatter to format a number as IDR or USD based on configuration in the source file (default: IDR with left position).
Consider migrating to a maintained alternative like 'react-native-currency-input' or use Intl.NumberFormat.
Add a type declaration: declare module 'react-native-currency-formatter';
Edit node_modules/react-native-currency-formatter/index.js to change currency settings, then use patch-package to persist changes.
If other currencies needed, switch to a more flexible library like 'intl' or 'currency.js'.
Ensure you are using a React Native environment; not suitable for plain React web apps.
Change import to: import CurrencyFormatter from 'react-native-currency-formatter';
In node_modules/react-native-currency-formatter/index.js, set currencyCode to 'IDR ' (note trailing space) or 'USD '.
Ensure the code runs in React Native; or provide a polyfill for Number.prototype.toLocaleString if in other environment.
No dependency data recorded yet.