RemyDuijkeren/NodaMoney
70.6
Strong · 8 November 2026
6.3k
lines of production code
C#
primary language
7
measurements over time
What this system is
NodaMoney is a .NET library for handling monetary values and currency data with a focus on precision and performance. It provides strongly-typed Money and FastMoney structs that support arithmetic, parsing, formatting, and serialization across multiple JSON and XML formats. The system includes a configurable MoneyContext for managing rounding strategies, currency defaults, and precision rules, which can be integrated via dependency injection. It also maintains comprehensive currency information aligned with ISO 4217 standards and includes benchmarks to validate its computational efficiency.
Features
Introduce MoneyContext for configurable rounding and currency defaults
Users can now configure monetary operations via a new \MoneyContext\ system, which centralizes settings for rounding strategies (including support for cash denomination rounding), precision, maximum scale, and default currency. This context can be registered via .NET Dependency Injection for global or scoped (per-request) usage, set as a thread-local context for background jobs, or applied dynamically via middleware, allowing applications to enforce specific financial rules without modifying individual \Money\ instances.
src/NodaMoney/Context · high confidence
Introduces FastMoney struct and StandardRounding strategy
Adds a new \FastMoney\ struct designed for high-performance monetary calculations, featuring operator overloads for addition, subtraction, multiplication, division, and modulus, as well as support for \decimal\ and \long\ operands. This type is accompanied by a new \StandardRounding\ class in the \Context\ namespace that implements the \IRoundingStrategy\ interface, providing configurable midpoint rounding (defaulting to Bankers' rounding) with optimized fast-paths for two-decimal currencies. These changes introduce new behavioral capabilities for efficient arithmetic and rounding within the library.
NodaMoney · high confidence
Introduces FastMoney struct and expands serialization support
The library now includes a new \FastMoney\ struct designed for high-performance monetary calculations, using a 64-bit fixed-point representation (scaled by 10,000) instead of \decimal\ to reduce memory usage and improve speed. This struct supports standard arithmetic, comparison, and unary operators, as well as conversions to and from minor units, \SqlMoney\, and OLE Automation Currency. Additionally, the \Currency\ struct now implements \IXmlSerializable\ and \ISerializable\, enabling native XML and binary serialization support alongside the existing JSON converters.
src/NodaMoney · high confidence
New Dependency Injection integration for MoneyContext
The NodaMoney.DependencyInjection package now provides extension methods to easily register and configure the MoneyContext within .NET's dependency injection container. Users can add a default or named MoneyContext using action-based configuration, direct options instances, or by binding to application configuration sections (e.g., appsettings.json). This enables injecting MoneyContext into services and supports multiple named contexts for scenarios requiring different currency or rounding rules across different parts of an application.
src/NodaMoney.DependencyInjection · high confidence
Behavioural changes
New v2 serialization format and context-aware deserialization for Money and Currency
The serialization layer has been updated to support a new default string format for Money (e.g., "EUR 234.25") while maintaining backward compatibility with the previous JSON object structure ({ "Amount": ..., "Currency": ... }). Deserialization now respects the \MoneyContext\, allowing users to opt-in to exact round-tripping (no rounding) by providing a specific context to the \MoneyJsonConverter\. Additionally, new converters have been introduced for \System.Text.Json\ (\CurrencyJsonConverter\, \MoneyJsonConverter\) and \TypeConverter\/\Newtonsoft.Json\ (\CurrencyTypeConverter\, \MoneyTypeConverter\) to handle these changes consistently across different serialization libraries.
src/NodaMoney/Serialization · high confidence
Test coverage
Add serialization tests for BinaryFormatter and DataContractSerializer; Added XML serialization tests for Money and Currency; Added comprehensive test coverage for Money binary operators; Added comprehensive tests for Money parsing across cultures and formats; Added comprehensive unit tests for CurrencyInfo behavior; Added serialization test data for Money objects; Added test helper utilities for culture isolation and parallel execution control; Added tests for Currency equality, creation, and default behavior; Added tests for ExchangeRate parsing, conversion, and equality; Added tests for FastMoney binary operators; Added tests for FastMoney conversion and minor unit handling; Added tests for FastMoney creation and context handling; Added tests for GetCurrencyInfo globalization extensions; Added tests for Money and FastMoney conversion and creation behaviors; Added tests for Money comparison and zero-currency matching behavior; Added tests for Money numeric interface members; Added tests for Money rounding, context scaling, and calculation precision; Added tests for Money unary operators; Added tests for Money.Split behavior and context preservation; Added tests for MoneyContext creation and scope management; Added tests for Newtonsoft.Json serialization of Money and Currency; Added tests for System.Text.Json serialization and deserialization of Money and Currency; Added tests for creating Money instances in five major currencies; Added tests to validate NodaMoney currency data against the official ISO 4217 list; Added unit tests for MoneyContext DI extension methods; Expanded benchmark suite for Money and FastMoney operations; Expanded test coverage for Money creation, equality, and context handling; Expanded test coverage for Money formatting behaviors.
Dependencies
Add NodaMoney.DependencyInjection package and update .NET target frameworks
The NodaMoney library now includes a new NodaMoney.DependencyInjection package that provides dependency injection extensions for configuring MoneyContext via Microsoft.Extensions.Options and Configuration.Abstractions. The core NodaMoney and test projects have been updated to target .NET 8.0, .NET 9.0, and .NET 10.0 (in addition to .NET Standard 2.0/2.1), with .NET 8+ builds marked as AOT-compatible. Test dependencies have been refreshed, including FluentAssertions to 8.8.0, xunit to 2.9.3, and version-specific adjustments for Microsoft.Extensions.DependencyInjection and System.Text.Json across frameworks.
(dependencies) · high confidence
Housekeeping
Repository standardizes on .editorconfig and modernizes .gitignore
The project now enforces consistent code formatting and IDE hygiene through a new \.editorconfig\ file that defines C\# style rules (such as brace placement, indentation, and naming conventions) and standardizes indentation for XML and config files. The \.gitignore\ has been significantly simplified to exclude modern build artifacts (\bin\, \obj\, \artifacts\) and IDE-specific directories (\.vs\, \.vscode\, \.idea\), while the legacy \.gitattributes\ file has been removed.
(repo-wide) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 63 → 71 (+7.9)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 83 → 83 (+0.0)
- Architecture 100 → 75 (-24.9)
- Maturity 45 → 73 (+27.3)
- Readiness 70 → 74 (+3.9)
- Security 77 → 65 (-11.7)
- Performance 100 → 100 (+0.0)
Resolved (6)
- Documentation: contradicts the code (docs/plans/2026-09-02-1035-fix-deserialization-money-context-plan.md)
- Inconsistent pluralization of currency names in test method names. 'CreateEuros', 'CreateDollars', 'CreateYuan', and 'CreateYens' use plural forms (or inconsistent singular/plural usage for Yuan/Yen), while 'CreatePonds' uses a non-standard plural form for 'Pound'. The concept is creating money instances for specific currencies, but the naming convention for the currency identifier varies between singular/plural and standard/non-standard forms.
- Low coverage: src/NodaMoney/Money.Serializable.cs (src/NodaMoney/Money.Serializable.cs)
- Off-boarding risk: anonymized user #1
- XML-doc coverage: NodaMoney(net10.0) (src/NodaMoney/NodaMoney.csproj)
- XML-doc coverage: NodaMoney.DependencyInjection(net10.0) (src/NodaMoney.DependencyInjection/NodaMoney.DependencyInjection.csproj)
New (10)
- Off-boarding risk: anonymized user #1
- doc comments repeat the names (src/NodaMoney/Currency.cs)
- doc comments repeat the names (tests/NodaMoney.Tests/Helpers/UseCultureAttribute.cs)
- redundant comment (src/NodaMoney.DependencyInjection/MoneyContextExtensions.cs)
- redundant comment (src/NodaMoney.DependencyInjection/MoneyContextExtensions.cs)
- redundant comment (src/NodaMoney.DependencyInjection/MoneyContextExtensions.cs)
- redundant comment (src/NodaMoney/Context/MoneyContext.cs)
- redundant comment (src/NodaMoney/Context/MoneyContext.cs)
- redundant comment (src/NodaMoney/FastMoney.Convertible.cs)
- redundant comment (src/NodaMoney/Money.cs)
Architecture
- Unchanged — 0 containers · 1 contexts · 0 edges
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
RemyDuijkeren/NodaMoney 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 8 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit b27ca9900415b9b3470e20cbaac667a3c3cae7ed — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-45ab2cab63de.