Fix previous commit: Same float format in Query grid as in Data grid

This commit is contained in:
Ansgar Becker
2009-03-09 22:38:38 +00:00
parent 917adf24ce
commit 8b65a83953
2 changed files with 7 additions and 2 deletions

View File

@ -299,6 +299,9 @@ const
// Data grid: How many rows to display in total
GRIDMAXTOTALROWS = 100000;
// Used to format floats in datagrids via FormatFloat()
GRIDFLOATFORMAT = '0.0##############################';
// How many milliseconds to wait before showing a 'waiting for database' sign.
QUERYWAITTIME: Integer = 2500;

View File

@ -4785,6 +4785,8 @@ begin
for j:=0 to ds.FieldCount-1 do begin
if FQueryGridResult.Columns[j].IsBinary then
FQueryGridResult.Rows[i].Cells[j].Text := '0x' + BinToWideHex(ds.Fields[j].AsString)
else if FQueryGridResult.Columns[j].IsFloat then
FQueryGridResult.Rows[i].Cells[j].Text := FormatFloat(GRIDFLOATFORMAT, MakeFloat(ds.Fields[j].AsString))
else
FQueryGridResult.Rows[i].Cells[j].Text := ds.Fields[j].AsWideString;
FQueryGridResult.Rows[i].Cells[j].IsNull := ds.Fields[j].IsNull;
@ -7633,7 +7635,7 @@ begin
if res.Columns[j].IsBinary then
res.Rows[i].Cells[j].Text := '0x' + BinToWideHex(ds.Fields[j].AsString)
else if res.Columns[j].IsFloat then
res.Rows[i].Cells[j].Text := FormatFloat('0.0##############################', MakeFloat(ds.Fields[j].AsString))
res.Rows[i].Cells[j].Text := FormatFloat(GRIDFLOATFORMAT, MakeFloat(ds.Fields[j].AsString))
else
res.Rows[i].Cells[j].Text := ds.Fields[j].AsWideString;
res.Rows[i].Cells[j].IsNull := ds.Fields[j].IsNull;
@ -7696,7 +7698,7 @@ begin
if res.Columns[j].IsBinary then
res.Rows[i].Cells[j].Text := '0x' + BinToWideHex(ds.Fields[j].AsString)
else if res.Columns[j].IsFloat then
res.Rows[i].Cells[j].Text := FormatFloat('0.0##############################', MakeFloat(ds.Fields[j].AsString))
res.Rows[i].Cells[j].Text := FormatFloat(GRIDFLOATFORMAT, MakeFloat(ds.Fields[j].AsString))
else
res.Rows[i].Cells[j].Text := ds.Fields[j].AsWideString;
res.Rows[i].Cells[j].IsNull := ds.Fields[j].IsNull;