Using numeric field type the results is the same as for double
insert into TABLE1 (FIELD_FLOAT, FIELD_DOUBLE, FIELD_NUMERIC) values (0.15,
9.11)
In the DBgrid I see:
FLOAT field: 0.150000005960464
DOUBLE field: 9.109999999999999
NUMERIC(12,2) field: 9.109999999999999
It is a formatting problem.
I will try with displayformat
a.
Pieter Valentijn wrote:
Use numeric(12,2) or what ever to create a numeric field with set
decimal.
Met vriendelijke groet,
Pieter Valentijn
Delphidreams
http://www.delphidreams.nl
-----Oorspronkelijk bericht-----
Van: Andrea Mauri [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 8 mei 2007 17:33
Aan: lazarus@miraclec.com
Onderwerp: [lazarus] TDBgrid float: bug?
Dear all,
I have some problems with TDBgrid and float values.
Firebird database.
I have a table with two fields.
One field is a (FIELD_FLOAT) FLOAT and the other DOUBLE PRECISION
(FIELD_DOUBLE).
I tried some inserts and I show the table using DBGrid.
If I exec this:
insert into TABLE1 (FIELD_FLOAT, FIELD_DOUBLE) values (0.15, 9.11)
In the DBgrid I see:
FLOAT field: 0.150000005960464
DOUBLE field: 9.109999999999999
In delphi I see the same as in lazarus for the float field but for the
double I see correctly 9.11
I think that there are some problems with significant digits.
I tried to explore the code of TDBgrid ut I was not able to understand
it. I am a newbie.
Any help, suggestion?
a.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives
--
Andrea Mauri
PhD student - Chemical Sciences
Milano Chemometrics and QSAR Research Group
Department of Environmental Sciences
University of Milano-Bicocca
P.zza della Scienza, 1
20126 Milano - Italy
Tel: ++39 02 64482801
mailto:[EMAIL PROTECTED]
http://www.disat.unimib.it/chm/
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives