moneycurrency 1.0.0 copy "moneycurrency: ^1.0.0" to clipboard
moneycurrency: ^1.0.0 copied to clipboard

Money and Currency library for Dart.

Money and Currency value objects for Dart #

A Money is a value object that represents an amount and an associated currency. Amounts either represent a real value (e.g. -$1927.10, ¥10, £1.56, 0.00kr.) or are unavailable (e.g. have no numerical value).

☞ In many financial applications, host systems can be unavailable throughout the day due to batch jobs running etc, and for this reason, amounts have notion of being unavailable.

This library is open source (BSD-2). Development occurs on GitHub. Package is hosted on dart packages.

Looking for an Swift implementation?.

Features #

Money objects can be compared, hashed, added and subtracted. Using a MoneyFormatter class, Money objects can be converted to and from strings.

Distribution #

  • Minimum Dart version 2.12 (null safety)
  • Friendly BSD-2 license

Installation #

Import the library into your Dart code using:

import 'package:moneycurrency/moneycurrency.dart';

Money example

var NZD = CurrencyManager().get('NZD')!;
var amount1 = Money.string('4.51', NZD);
var amount2 = Money.string('1020.04', NZD);
var total = amount1 + amount2; // 1024.55
print(total.toString(symbols: true, grouping: true)); // $1,024.55
3
likes
130
pub points
56%
popularity

Publisher

verified publisherelectricbolt.co.nz

Money and Currency library for Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

Dependencies

decimal

More

Packages that depend on moneycurrency