View Issue Details

IDProjectCategoryView StatusLast Update
0037799FPCFCLpublic2020-09-23 02:17
ReporterYiannis Dondos Assigned To 
Status newResolutionopen 
Product Version3.2.0 
Summary0037799: Bad output for FormatFloat
DescriptionExponent part for small values looks wrong (minus sign appears twice). Big values look good. Tested on Win32/i386 and Linux/amd64.
TagsNo tags attached.
Fixed in Revision
Attached Files


Yiannis Dondos

2020-09-22 22:41


testexpo.pas (212 bytes)   
program testexpo;

uses SysUtils;

     writeln (FormatFloat ('0.000E+000', 0.0012345)); // prints 1,235E-0-3 (incorrect)
     writeln (FormatFloat ('0.000E+000', 12345.67)); // prints 1,235E+004 (ok)
testexpo.pas (212 bytes)   

jamie philbrook

2020-09-22 22:48

reporter   ~0125764

I believe that is the same issue that was reported before and a fix was offered but I don't think it went anywhere, at least I didn't see it being accepted or even discussed.

I believe @WP was at the helm on this one

Marco van de Voort

2020-09-22 23:00

manager   ~0125765

Last edited: 2020-09-22 23:00

View 2 revisions

Still happens in FPC 3.2.1 as of yesterday, fixed in trunk.


r46778 | jonas | 2020-09-05 20:44:57 +0200 (Sat, 05 Sep 2020) | 2 lines
Changed paths:
   M /trunk/rtl/objpas/sysutils/
   A /trunk/tests/test/units/sysutils/tw37374.pp

  * fix formatfloat for 0 in exponential format (based on patch by
    Jamie Philbrook, mantis 0037374)

jamie philbrook

2020-09-23 02:17

reporter   ~0125766

I guess it didn't get merged to 3.2.x, maybe this can be done ?

Issue History

Date Modified Username Field Change
2020-09-22 22:41 Yiannis Dondos New Issue
2020-09-22 22:41 Yiannis Dondos File Added: testexpo.pas
2020-09-22 22:48 jamie philbrook Note Added: 0125764
2020-09-22 23:00 Marco van de Voort Note Added: 0125765
2020-09-22 23:00 Marco van de Voort Note Edited: 0125765 View Revisions
2020-09-23 02:17 jamie philbrook Note Added: 0125766