I found abnormal behavior regarding number formatting. If I compile for 64bit I get the desired result while if I compile for 32bit the formatting is changed by adding unwanted zeros (but only to certain values: at the moment the one in the example).
The problem with floating point values is that values, e.g. -96.9, even if they look "nice" to us, cannot be represented exactly like that in the binary system with the number of bytes provided (8 for double).
For the general number format, fpspreadsheet rounds to 15 digits before stripping the trailing zeros. Don't ask me why this is sufficient for 64bit code, but not for 32bit. Looking at LibreOffice Calc I found that the value of pi is displayed in a very wide cell with 14 digits, Excel even allows only for 9 digits. Therefore, I reduced the 15 digits to 14, and this seems to fix the issue. Please test the new revision.
If I use the "save" button and try to open the file obtained with LibreOffice (6.1.4.2 (x64)) the field that should be saved as text (columns C and D) is formatted as a number (however the cell is displayed correctly).
I don't understand: When a cell contains text it cannot be formatted as number (of course, you can apply the format, but it will be ignored as long as the cell contains text; it will be used only when the cell is changed to contain a number).
Maybe there is something if cell type number + WordWrap?
If a cell contains a number and is formatted with wordwrap, the wordwrap is ignored.
When you have text with wordwrap and want to display the entire text in a higher cell you should set the RowHeightType of the row to rhtAuto:
function TForm1.AddNewRow: Integer;
begin
with Grid.Worksheet do
begin
with AddRow(GetLastRowIndex+1)^ do begin
RowHeightType := rhtAuto;
Result := Row;
end;
FormatRow(Grid.RowCount-1);
end;
end;
P.S.
I see in your code that you do not use the fpspreadsheet packages but add the path to the source to the unit path of your project. I know that this is common practice in Delphi, but in Lazarus you should add the packages to the requirements of the projects - then the IDE takes care of finding the files needed. This also works when I, the maintainer of fpspreadsheet, once decide to move source files to other directories. And sometimes very complex compilation issues can occur when a project is allowed to compile the sources of required packages.