From 917adf24cee4925e79f62c7ab93b020d3e5c815a Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Mon, 9 Mar 2009 20:56:59 +0000 Subject: [PATCH] Fix issue #1012: Formatting floats and decimals --- source/main.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/main.pas b/source/main.pas index bbe37593..e14e3a4c 100644 --- a/source/main.pas +++ b/source/main.pas @@ -7632,6 +7632,8 @@ begin for j := 0 to ds.Fields.Count - 1 do 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)) else res.Rows[i].Cells[j].Text := ds.Fields[j].AsWideString; res.Rows[i].Cells[j].IsNull := ds.Fields[j].IsNull; @@ -7693,6 +7695,8 @@ begin for j := 0 to ds.Fields.Count - 1 do 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)) else res.Rows[i].Cells[j].Text := ds.Fields[j].AsWideString; res.Rows[i].Cells[j].IsNull := ds.Fields[j].IsNull;