dinero-formatting
>
Works with
Claude CodeCursorCodex CLIGitHub CopilotGemini CLI
--- name: dinero-formatting description: > license: MIT --- # Dinero.js Formatting Patterns for formatting [Dinero.js](https://v2.dinerojs.com) monetary values for display. Covers currency symbols, locale-aware formatting, non-decimal currencies, and serialization. ## When to Apply Reference these guidelines when: - Displaying prices, totals, or monetary values in a UI - Adding currency symbols or locale-specific formatting - Formatting non-decimal currencies (e.g., historical currencies with non-base-10 subdivisions) - Serializing Dinero objects for APIs, databases, or transport - Building reusable formatting utilities ## Rule Categories by Priority | Priority | Category | Impact | Prefix | | -------- | ------------- | -------- | ---------------- | | 1 | Display | CRITICAL | `display-` | | 2 | Locale | HIGH | `locale-` | | 3 | Serialization | HIGH | `serialization-` | | 4 | Non-Decimal | MEDIUM | `nondecimal-` | ## Quick Reference ### 1. Display (CRITICAL) - `display-to-decimal` - Use `toDecimal` for display strings, not `toSnapshot` - `display-no-currency-symbols` - Dinero.js does not format currency symbols; compose with `Intl.NumberFormat` ### 2. Locale (HIGH) - `locale-intl-formatter` - Build reusable formatters with `Intl.NumberFormat` - `locale-multilingual` - Create locale-parameterized formatters for multilingual sites ### 3. Serialization (HIGH) - `serialization-snapshot` - Use `toSnapshot` for transport and storage, not display - `serialization-bigint-json` - BigInt Dinero objects require a custom JSON replacer ### 4. Non-Decimal (MEDIUM) - `nondecimal-to-units` - Use `toUnits` for non-decimal currencies, not `toDecimal` ## How to Use Read individual rule files for detailed explanations and code examples: ``` rules/display-no-currency-symbols.md rules/locale-intl-formatter.md ``` Each rule file contains: - Brief explanation of why it matters - Incorrect code example with explanation - Correct code example with explanation - Additional context and references
More General & Other skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
1.5M
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
972.7k
grill-with-docs
mattpocock/skills
A relentless interview to sharpen a plan or design, which also creates docs (ADR's and glossary) as we go.
828.8k

