Skip to content
CAI
Software that uses CAICheck a score

elixirmoney/money

71.0

Strong · 3 October 2026

1.8k

lines of production code

Elixir

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Money library for Elixir that provides robust handling of monetary values, including parsing, arithmetic, and display formatting with support for multiple currencies. It offers comprehensive Ecto integration for persisting money and currency data across various database types, such as PostgreSQL and MySQL. The library ensures precision through the Decimal library and allows for flexible configuration of currency definitions and output formatting.

Features

Add Ecto type for currency storage

A new Ecto type, Money.Currency.Ecto.Type, is introduced to allow storing currency codes in database schemas. This type maps currency atoms to strings for persistence and supports casting from strings, atoms, or Money structs, ensuring compatibility with Ecto 3.2+ while maintaining backward compatibility with older versions.

lib/money/currency · high confidence

New Ecto types for multi-currency and numeric currency storage

This change introduces several new Ecto types to the library, enabling more flexible storage of monetary values and currencies. \Money.Ecto.Composite.Type\ allows storing multi-currency amounts in PostgreSQL using a custom composite type, while \Money.Ecto.Map.Type\ provides a JSON-based alternative for databases like MySQL that lack composite type support. Additionally, \Money.Ecto.NumericCurrency.Type\ enables storing currencies as ISO 4217 numeric codes (integers) rather than strings or atoms, and \Money.Ecto.Currency.Type\ is updated to support casting from atom maps. These additions expand the library's compatibility with various database schemas and data representation needs.

lib/money/ecto · high confidence

Behavioural changes

Major overhaul of Money struct and parsing logic

The Money library has been significantly refactored to support more flexible currency handling and parsing. The \Money.new/2\ function now accepts string currency keys in addition to atoms, and \Money.parse/1\ has been expanded to accept numbers, strings, and Decimal types, including support for scientific notation and negative values. The module now relies on \Decimal\ (with fallback to \Float\) for precision and introduces new configuration options for string formatting, such as separators, delimiters, and symbol placement. Additionally, the API has been updated to include new functions like \Money.add/2\, \Money.subtract/2\, \Money.divide/2\, and \Money.cmp/2\, while removing older arithmetic functions like \Money.multiply/2\.

lib · high confidence

Refactored Money library with new currency and display configuration modules

The \lib/money\ location has been restructured to support more granular configuration and extended currency data. A new \Money.Currency\ module now centralizes currency definitions, including ISO 4217 numbers and updated symbols for currencies like the Mexican Peso, Colombian Peso, and Danish Krone, while also allowing custom currencies to be configured at runtime. Display formatting is now handled by \Money.DisplayOptions\, which introduces new configuration options such as \strip\_insignificant\_fractional\_unit\ and \minus\_sign\_first\ to control how money strings are rendered. Additionally, the library adds \Money.ParseOptions\ for parsing configuration, \Money.Guards\ for type checking in guard clauses, and \Money.Sigils\ to support the \\~M\ sigil for creating Money structs at compile time. The deprecated \Money.Ecto.Type\ module remains for backward compatibility but warns users to migrate to \Money.Ecto.Amount.Type\.

lib/money · high confidence

Removed default configuration file

The default application configuration file (config/config.exs) has been removed. This file previously contained only comments and no active settings, so its removal has no impact on application behavior or user experience.

config · high confidence

Test coverage

Added test coverage for Ecto money types; Added test coverage for Money library components; Expanded test coverage for Money parsing and configuration.

Dependencies

Support for Decimal 2.0 via isolated build environments

The blend package now supports the \decimal\ library version 2.0 alongside version 1.2 by introducing isolated build environments. A new \premix.exs\ script allows users to select a specific dependency configuration via the \BLEND\ environment variable, which dynamically points the Mix tooling to the corresponding lockfile (\decimal\_1\_2.mix.lock\ or \decimal\_2\_0.mix.lock\) and isolated dependency/build directories. This enables the \Money.parse/1\ function to operate correctly with either \decimal \~\> 1.2\ or \decimal \~\> 2.0\ without version conflicts.

blend · high confidence

Upgrade to Elixir 1.11+ and expand optional dependency support

The Money library now requires Elixir 1.11 or later and updates its optional dependencies to support newer major versions: Ecto 3.0+, Phoenix.HTML 4.0, and Decimal 3.0. This change ensures compatibility with modern Elixir ecosystems and allows users to leverage the latest features in these libraries. Additionally, the project introduces a new \check\ alias for running formatting, Credo, tests, and Dialyzer, and updates the package metadata to include maintainers and a changelog link.

(dependencies) · high confidence

Housekeeping

Initial project scaffolding and CI configuration

This change introduces the foundational configuration files for the Elixir project, including \.credo.exs\ for code linting and \.formatter.exs\ for code formatting. It also adds \blend.exs\ and corresponding lockfiles (\decimal\_1\_2\, \decimal\_2\_0\) to support testing against different versions of the \decimal\ library, and migrates the continuous integration setup from Travis CI (\.travis.yml\) to GitHub Actions. Additionally, it updates the \README.md\ with modern installation and usage instructions, adds \CHANGELOG.md\ and \CONTRIBUTING.md\, and renames \LICENSE\ to \LICENSE.md\.

(repo-wide) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 70 → 71 (+0.7)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 100 → 100 (+0.0)
  • Architecture 100 → 100 (+0.0)
  • Maturity 56 → 56 (+0.0)
  • Readiness 67 → 69 (+2.4)
  • Security 99 → 99 (+0.3)

Resolved (2)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)

New (1)

  • Documentation: no architecture or design documentation

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

elixirmoney/money was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 4a337ac8a0ff8bde81d514f571c98d4220f6f9b8 — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.