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

在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.

相关文章

Format[$] ( expr [ , fmt ] ) format 返回变体型 format$ 强...
VB6或者ASP 格式化时间为 MM/dd/yyyy 格式,竟然没有好的办...
在项目中添加如下代码:新建窗口来显示异常信息。 Namespace...
转了这一篇文章,原来一直想用C#做k3的插件开发,vb没有C#用...
Sub 分列() ‘以空格为分隔符,连续空格只算1个。对所选...
  窗体代码 1 Private Sub Text1_OLEDragDrop(Data As Dat...