View Issue Details

IDProjectCategoryView StatusLast Update
0029781FPCDatabasepublic2017-08-17 02:48
ReporterEdson LidorioAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows 7OS Versionseven
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0029781: Problems DisplayFormat Lazarus 1.6 fpc 3.0
DescriptionI'm having problems DisplayFormat property (###,##0.00)
It is not working anymore in Lazarus 1.6 fpc. 3.0.
Anyone ever had this problem?

Note: In Lazarus 1.4 fpc 2.6.4 is normal. I'm using with Zeos.
TagsNo tags attached.
Fixed in Revision36740.
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0026803 feedbackMichael Van Canneyt FloatToStrF inserts wrong thousand separator 
has duplicate 0031198 resolvedMichael Van Canneyt FormatFloat / FloatToTextFmt : Thousand Separator 9999.99 instead of 9,999.99 
related to 0030950 resolvedMichael Van Canneyt FormatFloat gives wrong separator positions with extended numbers 

Activities

Edson Lidorio

2016-03-05 01:30

reporter  

laz144fpc264.png (9,239 bytes)
laz144fpc264.png (9,239 bytes)

Edson Lidorio

2016-03-05 01:31

reporter  

laz160fpc300.png (8,402 bytes)
laz160fpc300.png (8,402 bytes)

Bambang Pranoto

2016-03-05 12:00

reporter   ~0090651

Works for me. Using Qt widgetset on linux

wp

2016-03-05 12:19

reporter   ~0090652

Working for me as well (Win 7):

program Project1;

{$mode objfpc}{$H+}

uses
  SysUtils;

var
  x: Double;
begin
  x := 2222.0;
  WriteLn(FormatFloat('#,##0.00', x));
  ReadLn;
end.

==> output is 2.222,00

(my Formatsettings have dot as thousand sep and comma as decimal sep).

wp

2016-03-05 12:26

reporter   ~0090653

No - i have to correct myself. If the format string is '###,##0.00' as in your report I see the same output as you (my example used only '#,##0.00');

But in my opinion this format string is not correct, one (even no) # before the thousand separator is enough to signal that a thousand separator is to be used. What would be the advantage of the other two "#"? They will not leave an output if the the number is smaller than 10000.

On the other hand, like you, I would expect fpc to ignore them.

Bambang Pranoto

2016-03-05 17:03

reporter   ~0090666

Here is my code, I even do not use #

constructor TForm1.Create(AOwner: TComponent);
var
  Fld : TField;
begin
  inherited Create(AOwner);
  Fld := TFloatField.Create(Self.BufDataset1);
  Fld.FieldName:= 'VALUE1';
  TNumericField( Fld).DisplayFormat:=',0.00';
  Fld.DataSet := Self.BufDataset1;
  //
  Fld := TFloatField.Create(Self.BufDataset1);
  Fld.FieldName:= 'VALUE2';
  TNumericField( Fld).DisplayFormat:=',0.00';
  Fld.DataSet := Self.BufDataset1;
  //
  Self.BufDataset1.CreateDataset;
  Self.BufDataset1.Open;
  Self.BufDataset1.Insert;
  Self.BufDataset1.Fields[0].AsFloat:= 2322.50;
  Self.BufDataset1.Fields[1].AsFloat:= 12322.50;
  //
  Self.DBEdit1.DataSource := Self.DataSource1;
  Self.DBEdit1.DataField:='VALUE1';
  //
  Self.DBEdit2.DataSource := Self.DataSource1;
  Self.DBEdit2.DataField:='VALUE2';
end;

wp

2016-03-05 18:31

reporter   ~0090667

What do you want to say? Does the format string ',0.00' produce a correct, or a wrong result?

For me, FormatFloat(',0.00', 1234) displays '1,234.00', as exected.

Bambang Pranoto

2016-03-05 19:00

reporter   ~0090668

it produces correct result.

Edson Lidorio

2016-03-06 17:12

reporter   ~0090696

Because that is the difference between 1.4 and 1.6?

Edson Lidorio

2016-03-14 01:53

reporter   ~0090998

This problem is relating to: http://bugs.freepascal.org/view.php?id=29760

Edson Lidorio

2016-06-22 03:00

reporter   ~0093327

Hello,

Sorry to ask! I wonder if this problem will be gone for the next version?

Michael Van Canneyt

2016-06-22 08:52

administrator   ~0093330

If it is related to 0029760 then yes, it should be fixed in the next version 3.0.2.

If it is related to 0026803, then not.

Michael Van Canneyt

2017-07-17 18:24

administrator   ~0101739

Fixed. please test and close if OK

Edson Lidorio

2017-08-17 02:48

reporter   ~0102214

it's OK

Issue History

Date Modified Username Field Change
2016-03-05 01:30 Edson Lidorio New Issue
2016-03-05 01:30 Edson Lidorio File Added: laz144fpc264.png
2016-03-05 01:31 Edson Lidorio File Added: laz160fpc300.png
2016-03-05 12:00 Bambang Pranoto Note Added: 0090651
2016-03-05 12:19 wp Note Added: 0090652
2016-03-05 12:26 wp Note Added: 0090653
2016-03-05 12:56 Bart Broersma Project Lazarus => FPC
2016-03-05 17:03 Bambang Pranoto Note Added: 0090666
2016-03-05 18:31 wp Note Added: 0090667
2016-03-05 19:00 Bambang Pranoto Note Added: 0090668
2016-03-06 17:12 Edson Lidorio Note Added: 0090696
2016-03-14 01:53 Edson Lidorio Note Added: 0090998
2016-03-20 19:21 Michael Van Canneyt Relationship added related to 0026803
2016-03-20 19:21 Michael Van Canneyt Assigned To => Michael Van Canneyt
2016-03-20 19:21 Michael Van Canneyt Status new => assigned
2016-06-22 03:00 Edson Lidorio Note Added: 0093327
2016-06-22 08:52 Michael Van Canneyt Note Added: 0093330
2016-11-20 11:11 Michael Van Canneyt Relationship added related to 0030950
2017-07-17 18:24 Michael Van Canneyt Fixed in Revision => 36740.
2017-07-17 18:24 Michael Van Canneyt Note Added: 0101739
2017-07-17 18:24 Michael Van Canneyt Status assigned => resolved
2017-07-17 18:24 Michael Van Canneyt Fixed in Version => 3.1.1
2017-07-17 18:24 Michael Van Canneyt Resolution open => fixed
2017-07-17 18:24 Michael Van Canneyt Target Version => 3.2.0
2017-07-23 10:56 Michael Van Canneyt Relationship added has duplicate 0031198
2017-08-17 02:48 Edson Lidorio Note Added: 0102214
2017-08-17 02:48 Edson Lidorio Status resolved => closed