# Decimal (Elixir)

> Arbitrary precision decimal arithmetic

Source: https://talira.ai/catalog/decimal-elixir-dwg0md11
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / math / decimal arithmetic](https://talira.ai/categories/libraries/math/decimal-arithmetic)
- Licence: Apache-2.0[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Eric Meadows-Jönsson](https://talira.ai/orgs/eric-meadows-jonsson.md)

Decimal is the arbitrary precision decimal arithmetic library for Elixir. It represents each number as a sign, a coefficient and an exponent, so values of any size and with any number of decimal places are exact, and you choose how many digits of precision a calculation keeps. It parses, casts and formats decimals, and offers bounded parsing (a maximum number of digits and exponent) for untrusted input, since a compact value like 1e1000000 can take a lot of memory or CPU to expand.

## Links

- GitHub: https://github.com/ericmj/decimal
- Docs: https://hexdocs.pm/decimal/

## Problems it solves

- do money calculations in Elixir without floating point rounding errors
- store and compute exact decimal values from a database in Elixir
- parse decimal numbers from user input safely

## Features

- exact decimal numbers of any size
- configurable precision for calculations
- parse, cast and format decimals
- bounded parsing for untrusted input

## Trust

Overall: 0.48 out of 1.
Signals: maintenance 0.69, adoption 0.54, momentum 0.18, community 0.71, backing 0.30, extensibility 0.00.

- last commit 27 days ago
- 14 commits in the last 90 days
- latest release v3.2.0 50 days ago
- 478 GitHub stars
- 57 contributors
- backed by Eric Meadows-Jönsson

## Sources

[^1]: https://github.com/ericmj/decimal/blob/main/mix.exs (checked 27 Nov 2026)
