Board index » delphi » Numeric data type

Numeric data type

Hi,
Someone please help me. I would like to know what is the data
type for numeric in Delphi that comes with 2 decimal. In foxpro
database, I can have the field with data type numeric with 2
 decimal. but how about in Delphi?

Thanks.
sam

 

Re:Numeric data type


"sam" <samuell...@hotmail.com> wrote ...

Quote
> I would like to know what is the data type for numeric in
> Delphi that comes with 2 decimal.
> In foxpro database, I can have the field with data type
> numeric with 2 decimal; but how about in Delphi?

Sam, If you are asking what ObjectPascal variable type can be
used to hold numbers with two decimal fraction digits, then the
answer is "currency", although the floating binary point types
"single", "double", and "extended" are also useful, even though
they cannot hold such types as 0.10 to perfect precision.
Rgds, JohnH

Re:Numeric data type


Quote
sam wrote:
> Someone please help me. I would like to know what is the data
> type for numeric in Delphi that comes with 2 decimal. In foxpro
> database, I can have the field with data type numeric with 2
>  decimal. but how about in Delphi?

        Delphi is not a database.  If you want a suggestion for which field
type to use, you need to mention which DB server you're using.
        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
InterBase PLANalyzer 1.1 -- Free InterBase query optimization
  tool: http://delphi.weblogs.com/IBPLANalyzer

Re:Numeric data type


Quote
John Herbster (TeamB) wrote:
> Sam, If you are asking what ObjectPascal variable type can be
> used to hold numbers with two decimal fraction digits, then the
> answer is "currency", although the floating binary point types
> "single", "double", and "extended" are also useful, even though
> they cannot hold such types as 0.10 to perfect precision.

        For DB stuff in particular, look at TFMTBCDField and associated
functions.

        -Craig

--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
  Delphi/InterBase Weblog : http://delphi.weblogs.com
Useful articles about InterBase and Delphi development:
  http://delphi.weblogs.com/articles

Other Threads