加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

VB.NET最佳数据类型,用于存储货币值

发布时间:2020-12-17 00:22:20 所属栏目:大数据 来源:网络整理
导读:在VB.NET中存储货币值的最合适的数据类型是什么? 十进制(BCL中的别名为 System.Decimal structure)用于存储货币值.它是128位十进制浮点类型(与二进制浮点相反),可用于存储具有高小数精度的“真实世界”值.通过现实世界,我特别指的是最初以十进制形式进行的
在VB.NET中存储货币值的最合适的数据类型是什么?
十进制(BCL中的别名为 System.Decimal structure)用于存储货币值.它是128位十进制浮点类型(与二进制浮点相反),可用于存储具有高小数精度的“真实世界”值.通过现实世界,我特别指的是最初以十进制形式进行的测量. Double通常适用于在表示为十进制数时不需要那么多精度的计算.

The Decimal value type represents decimal numbers ranging from positive 79,228,162,514,264,337,593,543,950,335 to negative 79,335. The Decimal value type is appropriate for financial calculations requiring large numbers of significant integral and fractional digits and no round-off errors. The Decimal type does not eliminate the need for rounding. Rather,it minimizes errors due to rounding. For example,the following code produces a result of 0.9999999999999999999999999999 rather than 1.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读