Skip to content

[READ-ONLY PUBLIC MIRROR] Dart implementation of Fowler's Money pattern.

License

Notifications You must be signed in to change notification settings

LitGroup/money.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Money

This is a Dart implementation of the Money pattern, as described in [Fowler PoEAA]:

A large proportion of the computers in this world manipulate money, so it’s always puzzled me that money isn’t actually a first class data type in any mainstream programming language. The lack of a type causes problems, the most obvious surrounding currencies. If all your calculations are done in a single currency, this isn’t a huge problem, but once you involve multiple currencies you want to avoid adding your dollars to your yen without taking the currency differences into account. The more subtle problem is with rounding. Monetary calculations are often rounded to the smallest currency unit. When you do this it’s easy to lose pennies (or your local equivalent) because of rounding errors.

— Fowler, M., D. Rice, M. Foemmel, E. Hieatt, R. Mee, and R. Stafford, Patterns of Enterprise Application Architecture, Addison-Wesley, 2002.

This package provides the value type EmailAddress to have a typed representation of the e-mail address with the encapsulated validation.

Getting started

  1. Install the package as a dependency, running the command in the shell:

    dart pub add money
  2. Import the library:

    import 'package:money/money.dart';

About

[READ-ONLY PUBLIC MIRROR] Dart implementation of Fowler's Money pattern.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages