I received an email from Alexadre Boyer regarding a feature of my implementaiton of the Money class.
My C# implementation of the Money class was, originally, a port of the Money Pattern outlined in Martin Fowler’s book, Patterns of Enterprise Application Architecture. In the sample provided by Fowler, the amount is stored as a double. To avoid the floating point rounding problem, the authors implemented a scaled integer. In my original implementation, I used a long to represent the value and implemented the same pattern to avoid the floating point rounding problems. I’ve since refactored it to use decimal (making rounding decisions a responsibility of an external entity) and, in hindsight, it appears as though I should likely remove the CentFactor (or make it a public read-only property for those who may have a use for that value) as it, a) only serves to decrease performance in determining Amount, and b) the intent of the current implementation (now) is to force rounding to be taken care of external to the class.
I’ve made the change and republished the code.
Thank you, Alexandre, for noticing that oversight!