sql_money 1.0.3 copy "sql_money: ^1.0.3" to clipboard
sql_money: ^1.0.3 copied to clipboard

a class to work with numbers in the same way as ms-sql Money datatype as a 4dp constrained datatype for financial accuracy

A Money Library to replicate functionality of the ms-sql money type, and Delphi Currency type which is a numeric type accurate and rounded to 4dp. All Equivalences are converted to SqlMoney first before evaluation. All operations are done first, then converted.

Usage #

A simple usage example:

import 'package:sql_money/sql_money.dart';

main() {
  var value = SqlMoney(12.45);
  print(value); // 12.4500
  value += SqlMoney('3.00456');
  print(value); // 15.4546
  value += 38.00089;
  print(value); // 53.4555
  print(value.toStringAsFixed(2));

  print(SqlMoney(0) + '123.456' + 789.023); //912.4790
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
140
pub points
0%
popularity

Publisher

unverified uploader

a class to work with numbers in the same way as ms-sql Money datatype as a 4dp constrained datatype for financial accuracy

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

More

Packages that depend on sql_money