qmetrics.net

Decimal

Go library for arbitrary-precision fixed-point decimal arithmetic

shopspring/decimal provides fixed-point decimal types for Go with exact add, subtract, and multiply. It suits money calculations where float64 rounding is unacceptable.

Overview

decimal is a Go package implementing arbitrary-precision fixed-point decimal numbers. The zero value is usable as zero without initialization, and arithmetic methods return new values instead of mutating receivers, which reduces accidental aliasing compared with some big number APIs.

Operations include addition, subtraction, and multiplication without precision loss, division and square root with configurable rounding precision, and package-level settings that control division precision, power precision, string formatting, JSON marshaling, and decode exponent limits. Serialization supports database/sql, JSON, XML, and MongoDB BSON as Decimal128 with the official Go driver v2.

Install via go get against the GitHub module path. Trade-offs versus float64 and big.Rat matter for monetary amounts, with emphasis on exact string representations for financial splits. It requires Go 1.10 or newer.

Key features

  • Fixed-point decimal type for Go
  • Immutable arithmetic API
  • Configurable division and power precision
  • JSON and XML serialization
  • database/sql driver support
  • MongoDB Decimal128 BSON encoding
  • Global formatting and encoding toggles

Use cases

  • Monetary amounts without float rounding
  • Ledger or billing calculations in Go services
  • JSON APIs requiring decimal strings
  • Database-backed financial models
  • Splitting amounts across three recipients exactly

Tags

Similar software

Vnpy

Python framework for quantitative trading platforms

VeighNa (VnPy) is a Python-based quant trading development framework. It bundles gateways, strategy apps, charts, and event-driven APIs for building trader tooling.

★ 46.5k⟳ 1 month agoMIT

LEAN

Event-driven algorithmic trading engine

LEAN from QuantConnect backs research, backtesting, optimization, and live trading for multi-asset strategies in Python and C#.

★ 22.8k⟳ todayApache-2.0

RQAlpha

Python algorithmic backtest and trading framework

RQAlpha is an extensible Python framework for quantitative backtesting, paper trading, and live trading across stocks, futures, and related markets. It is intended for non-commercial programmatic trading workflows.

★ 6.9k⟳ 1 month agoApache-2.0

ECC

Open-source agent engineering toolkit for coding harnesses

ECC adds planning, verification, review, memory, skills, and security scanning to coding agents such as Claude Code, Codex, and Cursor. It installs as plugins, packages, and managed adapters across multiple harnesses.

★ 311.7k⟳ 8 days agoMIT
Frameworks & PlatformsDesktop/CLI app

React

JavaScript library for web and native user interfaces

React helps developers build interfaces from reusable components that manage their own state. Views update declaratively when underlying data changes.

★ 253k⟳ 2 days agoMIT
Frameworks & PlatformsDesktop/CLI app

Flutter

Open-source UI framework for multi-platform apps from one codebase

Flutter is an SDK for building user experiences for mobile, web, and desktop from a single codebase. It uses the Dart language and compiles to native machine code or web targets.

★ 181.5k⟳ todayBSD-3-Clause
Open Source Alternative to:Ionic Enterprise