1、paradox中的Money数据类型是以Double类型存储,计算如一般的Int类型进行加减;
2、Object Pascal中的currency数据类型同上;
3、显示两位是因为在控制面板-区域设置-货币中设置的,可根据需要修改;输入时可设置Edit的Mask属性,控制只能输入两位;
4、不是问题。作金额的合计和平均处理后可截断不需要的小数,谁在乎几分几厘?
5、这是戴妃内部保证的。

解决方案 »

  1.   

    我的经验:不要使用currency类型,他的精度不够,坚决使用双精度数。保证计算无误。
    显示的时候可以按照currency显示,可以在fields和grid中设置,也可以直接用formatfloat来显示。
    类型一定要选队呀,否则以后麻烦就大了 ;)
    (可以用 num和dbl型)
      

  2.   

    致Lin兄:
      1.那么要money的类型岂非多此一举?
      2.同上
      3.edit和dbgrid没有mask属性。
      4.我并不在乎几分几厘,但作帐套平衡时过不去咋办?
      5.保证到什么程度?
    请再赐教  data
      

  3.   

    1:就把钱型当做宝蓝的一个bug.2:(摘自delphi的help :)
    Type Range Significant digits Size in bytesReal 2.9 x 10-39 .. 1.7 x 1038 11-12 6
    Single 1.5 x 10-45 .. 3.4 x 1038 7-8 4
    Double 5.0 x 10-324 .. 1.7 x 10308 15-16 8
    Extended 3.4 x 10-4932 .. 1.1 x 104932 19-20 10
    Comp -263+1 .. 263 -1 19-20 8
    Currency -922337203685477.5808.. 922337203685477.5807  19-20 8The Comp (computational) type is a 64-bit integer that holds integral values from 
    -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (-263 to 263-1).
    The Currency type is a fixed-point data type suitable for monetary calculations. 
    It is stored as a scaled 64-bit integer with the four least-significant digits implicitly representing four decimal places. The range of Currency values is 
    -922,337,203,685,477.5808 to 922,337,203,685,477.5807. When mixed with other real types in assignments and expressions, values of type Currency are automatically scaled by dividing or multiplying by 10000. Since numbers stored in the Currency format are exact representations, operations on Currency values are not subject to rounding errors.3:到我主页有钱币录入控件: hxsoft.126.com.4:如果不用双精度数,我保证你平不了帐!5:说来说去就是不能用currency型.
      

  4.   

    currency应该可以了,我用它做数据类型,处理我们单位的数据,到几百亿没问题,
    再上去没有试过。计算量大的话,可以快一点。并且兼容性也好。
      

  5.   

    为何一定要用currency类型呢
    我的经验是将钱用分存入数据库类型选为char或varchar等字符型,在dbgrid中显示是加入计算字段使其按元或其他单位显示,同时在field editor中控制计算字段的maskedit属性即可
      

  6.   

    我怎么就觉得奇怪。这么多人对Money类型感兴趣。