应用程序使用十进制与双重。 。 [英] Applications using Decimal versus double . .
问题描述
我想看看是否有人对金融应用程序使用十进制而不是双倍。我已经看到很多人在这个地方使用了两倍,造成意想不到的后果。
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 consequences . .
您是否看到其他人犯了这个错误。 。
Do you see others making this mistake . . .
推荐答案
我们很遗憾,我们后悔。我们不得不把所有的双打变成小数。小数对于金融应用是有好处的。你可以看这篇文章
CLR的钱类型 :
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:
为CLR处理
算术运算,货币类型的方便,高性能的
结构,
格式化,仔细分配
和舍入无损。
A convenient, high-performance money structure for the CLR which handles arithmetic operations, currency types, formatting, and careful distribution and rounding without loss.
这篇关于应用程序使用十进制与双重。 。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!