TiloBox
Back to directory
Dinero.js project preview

Dinero.js

Immutable, type-safe library for creating, calculating, and formatting monetary values.

LicenseMIT
GitHub stars5.5k
Last commit1 weeks ago
Tags5 topics
Monetary ArithmeticDinerojs CurrencyCurrency CalculationsFinancial Math LibraryDeveloper Tools
Overview

Why consider Dinero.js?

Dinero.js is an open-source JavaScript and TypeScript library for precise monetary calculations and multi-currency formatting written by Sarah Dayan. Dinero.js eliminates floating-point rounding errors in eCommerce and billing apps by using immutable integer arithmetic and custom rounding rules.

Guided learning

Learn Dinero.js by building

Practical setup notes, real use cases, and copy-ready examples in one focused guide.

1 min read 2 sections
In this guide2 sections

Overview of Dinero.js

Dinero.js performs accurate financial calculations across multiple global currencies without rounding drift.

Quickstart

bash
1npm install dinero.js@alpha @dinero.js/currencies@alpha
typescript
1import { dinero, add } from 'dinero.js';
2import { USD } from '@dinero.js/currencies';
3
4const price1 = dinero({ amount: 500, currency: USD });
5const price2 = dinero({ amount: 250, currency: USD });
6const total = add(price1, price2);

Dinero.js is licensed under the permissive MIT License.

Related tools

More options with a similar category or technology profile.

Dinero.js FAQs

Dinero.js is listed as a Business tool on TiloBox. Review the overview, features, and official documentation on this page to decide whether it solves your specific workflow.

Start with the project's GitHub repository and official website for supported installation and deployment instructions. Test the setup with representative data or a small project before rolling it out more widely.

Dinero.js is listed under the MIT license. Read the complete license text and the project's notices before using, modifying, or distributing the software.

Production readiness depends on your requirements. Review maintenance activity, security practices, documentation, backup and upgrade procedures, and compatibility with your stack; then validate it in a non-production environment.

Dinero.js is listed as an alternative to Stripe Currency APIs. Compare the core workflow, deployment model, integrations, and licensing against your must-have requirements before switching.