Money data type for .NET?

后端 未结 8 1027
Happy的楠姐
Happy的楠姐 2021-01-31 02:52

Looking for a good Money data type for .NET that supports currencies and exchange rates (with related behaviour & operatio

8条回答
  •  清酒与你
    2021-01-31 03:50

    Money Data Type @ The Code Project

    http://www.codeproject.com/KB/vb/moneyDatatype.aspx

    Author states similar problem:

    as part of a recent application I realized how lacking .NET is for currency support, don't get me wrong, there are many "pieces" but the glue for all items is missing, so this article is a response to that.

    and fulfills objectives

    my main objectives became

    • Store the currency type with the value (i.e. AUD, US, DKK).
    • Store formatting details (i.e. decimal grouping, currency symbols, etc.).
    • Conversion providers, I didn't want to hard code this as it is a datatype and not a solution.
    • Development safety features (i.e. prevent arithmetic on different currency types).

    So far this the closest .NET code to what I'm searching for. It fulfills most requirements of Money.

    If anybody has something better it would be much appreciated.

提交回复
热议问题