Skip to content
pubscout

money2

6.3.1, released 3 weeks ago by onepub.dev

High-precision library for storing, parsing, formatting, and performing arithmetic on money.

WASM-readyRock solid
$ flutter pub add money2
Source repository

What it does

Money2 provides fixed-decimal storage and operations for monetary values to prevent floating-point rounding errors. It supports multi-currency definitions, custom formatting patterns, exchange rate conversions, and JSON serialization.

AI-written summary of version 6.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building financial, e-commerce, or business applications requiring precise decimal arithmetic.
  • You need to handle multiple currencies and safely format or parse monetary strings.

Skip it when

  • You only need basic floating-point arithmetic without currency context.

Strengths

  • Fixed-precision math avoids floating-point rounding surprises.
  • Comprehensive built-in world currencies and custom currency definitions.
  • Locale-agnostic pattern parsing and formatting.

Weaknesses

  • Exchange rates must be managed and provided manually rather than fetched from live APIs.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
4
final usd = Currency.create('USD', 2);
final price = Money.fromIntWithCurrency(1000, usd);
final tax = price * 0.1;
final total = price + tax;
print(total); // $11.00

Alternatives

Packages that do the same job and could replace money2.

  • zxing2

    Pure Dart library for encoding and decoding QR codes.

  • jiffy

    Parse, manipulate, query, and format dates and times in Dart and Flutter.

  • byte_converter

    High‑performance byte and data‑rate conversion with BigInt precision and built‑in localization.

  • time_machine2

    Comprehensive date and time library with support for timezones, calendars, cultures, and parsing.

Works with

Packages commonly used together with money2: ones it builds on, ones built on it, and its own family.