Applications using Decimal versus double . .

前端 未结 7 1577
感动是毒
感动是毒 2021-01-02 19:38

I wanted to see if folks were using decimal for financial applications instead of double. I have seen lots of folks using double all over the place with unintended conseque

7条回答
  •  甜味超标
    2021-01-02 20:13

    We did unfortunately and we regret it. We had to change all doubles to decimals. Decimals are good for financial applications. You can look at this article A Money type for the CLR:

    A convenient, high-performance money structure for the CLR which handles arithmetic operations, currency types, formatting, and careful distribution and rounding without loss.

提交回复
热议问题