Hi,
I was searching for a solution to this problem, but I can't get it solved yet:
I have a field declared as NUMERIC(9,2). At the time to get a value of 12.12, it is displaying on the Grid a number with a lot of decimal digits like 12.1199998855591
I am using Delphi 7, Zeos 6.6.1 (Beta) and Firebird 1.53
Can somebody help me solving this problem ?
Thanks in advance.
Manuel.
Displays of Numeric Fields with more than 2 Decimals
Moderators: gto, cipto_kh, EgonHugeist
-
- Fresh Boarder
- Posts: 2
- Joined: 04.07.2007, 17:24
- Location: Brownsville
Welcome ms_salinas!
This problem, at common sensus, is generated by delphi itselfs, while manipulating floating point values. I've never come deep into Zeos to clarify it, but it should be true.
Fortunately, there's a bypass. Doube click in the query component, select the field and type in the DisplayFormat propery: 0.00
EDIT: By the way, is has been discussed here: http://zeos.firmos.at/viewtopic.php?t=9 ... t=decimals
This problem, at common sensus, is generated by delphi itselfs, while manipulating floating point values. I've never come deep into Zeos to clarify it, but it should be true.
Fortunately, there's a bypass. Doube click in the query component, select the field and type in the DisplayFormat propery: 0.00
EDIT: By the way, is has been discussed here: http://zeos.firmos.at/viewtopic.php?t=9 ... t=decimals
-
- Fresh Boarder
- Posts: 2
- Joined: 04.07.2007, 17:24
- Location: Brownsville
Displays of Numeric Fields with more than 2 Decimals
Hi gto,
Regarding your suggestion to edit FiledsEditor... when I go there, the pop-up window is empty .
I am using the TZQuery Component, the SQL contains a sentence like this: "Select * From Cargos where Folio = :Folio"
I found this code and it solved the problem:
//---------------------
var
xInd : integer;
xFld : TField;
begin
for xInd := 0 to DM.CARGOS.Fields.Count-1 do
begin
xFld := DM.CARGOS.Fields[xInd];
case xFld.DataType of ftFloat :
TFloatField(xFld).DisplayFormat := '#,##0.00';
end;
end;
end;
//---------------------
I never had this problem when I used the IBX Components.
Thanks for your help.
Regarding your suggestion to edit FiledsEditor... when I go there, the pop-up window is empty .
I am using the TZQuery Component, the SQL contains a sentence like this: "Select * From Cargos where Folio = :Folio"
I found this code and it solved the problem:
//---------------------
var
xInd : integer;
xFld : TField;
begin
for xInd := 0 to DM.CARGOS.Fields.Count-1 do
begin
xFld := DM.CARGOS.Fields[xInd];
case xFld.DataType of ftFloat :
TFloatField(xFld).DisplayFormat := '#,##0.00';
end;
end;
end;
//---------------------
I never had this problem when I used the IBX Components.
Thanks for your help.
Hum.. glad to see it solved.
The popup is empty because you need to add the fields to the query when you want them to be objects. With the SQL and Conenction property filled, double click in the query and at the blank popup right click then select add all fields.
Anyway, the code you posted do the same thing
The popup is empty because you need to add the fields to the query when you want them to be objects. With the SQL and Conenction property filled, double click in the query and at the blank popup right click then select add all fields.
Anyway, the code you posted do the same thing