money2 1.0.0-beta.5 money2: ^1.0.0-beta.5 copied to clipboard
A user friendly implementation of LitGroup's Dart Money. Provides Money and Currency classes with fixed precision maths operations and a nice Money formatter.
import 'package:money2/money2.dart';
void main() {
final usd = Currency.create('USD', 2);
Money costPrice = Money.fromInt(10034530, usd); // 100,345.30 usd
costPrice.format("###,###.##");
// > 100,345.30
costPrice.format("S###,###.##");
// > $100,345.3
costPrice.format("CC###,###.#0");
// > US100,345.30
}