# shopspring/decimal

Arbitrary-precision fixed-point decimal numbers in Go

Repository: https://github.com/shopspring/decimal
Canonical: https://ross.abutalabs.com/products/decimal
Language: Go
License: NOASSERTION
License Family: other
Topics: go, decimals, precision, money, bignumber, golang
Last push: 2026-08-19T21:07:36+00:00

## Health v2 (maintenance only)
Score: 67/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 8, longevity 100
- inputs: {"age_days": 4207, "days_push": 14, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7469, forks 673 (observed 2026-08-28T04:10:00.088412+00:00)

## What it is
A Go library providing arbitrary-precision fixed-point decimal numbers to avoid floating-point rounding errors. It supports arithmetic operations, database/sql, JSON, and XML serialization.

## Use cases
- calculate money amounts without floating point errors
- exact decimal arithmetic in Go
- store prices in a database with decimal precision
- parse decimal strings like 0.1 accurately
- compute taxes and fees with no precision loss

## When to choose
- you need lossless addition, subtraction, and multiplication of decimals
- you work with monetary values or billing in Go
- you need database/sql and JSON serialization for decimals

## When to avoid
- you need extremely high performance and can tolerate limited precision (consider alpacahq/alpacadecimal or govalues/decimal)
- you need mutable big-decimal semantics with a richer API (consider cockroachdb/apd)

## Facets
- artifact type: library
- maturity: stable
- function: math, serialization
- domain: fintech, developer-tools, e-commerce
- platform: go
- tags: decimal-arithmetic, fixed-point, money, arbitrary-precision, financial-calculations

## Member repositories
- shopspring/decimal (main) score 67

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:00.088412+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-29T17:37:37.730195+00:00, confidence not recorded.
  - readme: https://github.com/shopspring/decimal (fetched 2026-08-28T04:10:00.088412+00:00, sha b36221e87f82)
- Data as of 2026-08-30T08:39:29.467469+00:00.
