Formatting patterns for the Dinero.js money library. Use when displaying monetary values to users, formatting prices with currency symbols, handling locale-specific number formats, or working with non-decimal currencies. Triggers on toDecimal, toUnits, toSnapshot calls, or Intl.NumberFormat usage with Dinero objects.
Patterns for formatting Dinero.js monetary values for display. Covers currency symbols, locale-aware formatting, non-decimal currencies, and serialization.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 |
| Display |
| CRITICAL |
display- |
| 2 | Locale | HIGH | locale- |
| 3 | Serialization | HIGH | serialization- |
| 4 | Non-Decimal | MEDIUM | nondecimal- |
display-to-decimal - Use toDecimal for display strings, not toSnapshotdisplay-no-currency-symbols - Dinero.js does not format currency symbols; compose with Intl.NumberFormatlocale-intl-formatter - Build reusable formatters with Intl.NumberFormatlocale-multilingual - Create locale-parameterized formatters for multilingual sitesserialization-snapshot - Use toSnapshot for transport and storage, not displayserialization-bigint-json - BigInt Dinero objects require a custom JSON replacernondecimal-to-units - Use toUnits for non-decimal currencies, not toDecimalRead individual rule files for detailed explanations and code examples:
rules/display-no-currency-symbols.md
rules/locale-intl-formatter.md
Each rule file contains: