Does anyone know of a money type in .NET?

前端 未结 3 1596
忘了有多久
忘了有多久 2020-12-16 11:46

Does anyone know of an already implemented money type for the .NET framework that supports i18n (currencies, formatting, etc)? I have been looking for a well implemented typ

3条回答
  •  情深已故
    2020-12-16 12:23

    i would use integer/long, and use a very low denomination like cents (or pence) - then there would be no decimal to work with, and all calculations can be rounded to the nearest cent.

    or, take a look at Martin Fowler's book "Patterns of Enterprise Application Architecture". In that book, he talked about how to implement a money class. http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420

提交回复
热议问题