# paupino/rust-decimal

Decimal number implementation written in pure Rust suitable for financial and fixed-precision calculations.

Repository: https://github.com/paupino/rust-decimal
Canonical: https://ross.abutalabs.com/products/rust-decimal
Homepage: https://docs.rs/rust_decimal/
Language: Rust
License: MIT
License Family: permissive
Topics: rust, decimal, financial-calculations, number
Last push: 2026-08-25T19:20:44+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 76, longevity 100
- inputs: {"age_days": 3581, "days_push": 8, "days_rel": 83, "gap_med": 56.0, "n_releases_24m": 9}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1329, forks 226 (observed 2026-08-28T04:04:23.926224+00:00)

## What it is
A pure Rust decimal number type providing exact fixed-precision arithmetic with a 96-bit integer mantissa, scaling factor, and sign. It is designed for financial and other calculations where floating-point round-off errors are unacceptable, with integrations for serde, Diesel, Postgres, and wasm.

## Use cases
- represent money and currency amounts without floating-point errors
- perform exact decimal arithmetic in Rust
- store decimal values in Postgres or MySQL via Diesel
- serialize decimals to JSON with serde
- run fixed-precision math in WebAssembly
- avoid binary float rounding in billing and accounting code

## When to choose
- you need exact decimal/fractional arithmetic in Rust, especially for money
- you want a mature, widely downloaded crate with database and serde integrations
- you need no_std or wasm support for decimal math

## When to avoid
- you only need approximate scientific computation where f64/f32 suffices
- you need arbitrary-precision or very large numbers beyond 96-bit mantissa
- you are not working in Rust

## Facets
- artifact type: library
- maturity: stable
- function: math, serialization
- domain: fintech, developer-tools
- platform: rust, wasm, cross-platform
- tags: decimal-arithmetic, fixed-precision, financial-calculations, no-std, postgres-integration, diesel-integration, algorithms

## Member repositories
- paupino/rust-decimal (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:23.926224+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:45:42.134767+00:00, confidence not recorded.
  - readme: https://github.com/paupino/rust-decimal (fetched 2026-08-28T04:04:23.926224+00:00, sha f97800e3a311)
  - homepage: https://docs.rs/rust_decimal/ (fetched 2026-08-29T12:04:50.689152+00:00, sha 13348b9583f9)
  - site_page: https://docs.rs/crate/rust_decimal/latest (fetched 2026-08-29T12:04:50.700678+00:00, sha dc733379d5dc)
  - site_page: https://docs.rs/ (fetched 2026-08-29T12:04:50.698844+00:00, sha aeb82924db4c)
  - site_page: https://docs.rs/crate/rust_decimal/latest/features (fetched 2026-08-29T12:04:50.703018+00:00, sha dc645213f0e7)
  - site_page: https://docs.rs/about (fetched 2026-08-29T12:04:50.704869+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T12:04:50.706718+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T12:04:50.708273+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T12:04:50.709938+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T12:04:50.711581+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
