From 505b833416e4c4bc23dcaf6a25303078bb71d12f Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 27 May 2017 17:44:51 +0000 Subject: [PATCH] fpspreadsheet: Fix formatting error of large numbers if grid column width is very narrow (TrimToCell). git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5906 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/visual/fpspreadsheetgrid.pas | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas index 231c3e3d7..d0df309be 100644 --- a/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas +++ b/components/fpspreadsheet/source/visual/fpspreadsheetgrid.pas @@ -21,11 +21,7 @@ unit fpspreadsheetgrid; - When Lazarus 1.4 comes out remove the workaround for the RGB2HLS bug in FindNearestPaletteIndex. - Arial bold is not shown as such if loaded from ods - - Background color of first cell is ignored. - - - Enter 1234567890 into a cell. reduce col width with mouse. Immediately - before display becomes #### there is 11E09 in the cell - it should be 1E09. - Cell not correctly erased? } + - Background color of first cell is ignored. } interface @@ -5408,7 +5404,7 @@ begin while decs > 0 do begin dec(decs); - nfs := '0.' + DupeString('0', decs) + 'E-00'; + nfs := IfThen(decs = 0, '0E-00', '0.' + DupeString('0', decs) + 'E-00'); Result := FormatFloat(nfs, ACell^.NumberValue, Workbook.FormatSettings); // Result := Format('%.*e', [decs, ACell^.NumberValue], Workbook.FormatSettings); if isStacked then