Sorting Incorrect

Hi,

When using floats with a float format set of %.0n the sort order is incorrect.

Thanks,

Ken
1 Like

Please post full sample code so we can investigate

Sorry, previously posted to the wrong issue:

.,,
  gToday.BeginUpdate;
  gToday.Clear;
  gToday.FloatFormat:='%.0n';
  gToday.Options.Grouping.CalcFormat:='%.0n';
...
  gToday.UpdateCalculations;
  gToday.EndUpdate;

Hi,


Can you send us a sample instead to support@tmssoftware.com so we can investigate this here? Together with the summary footer row

Sample sent.

Hi, any news here? It seems I have the same problem.
I have created a new TMSFNCDataGrid.
Added a new column and filled the column with random float values.
If I filter for values > 40000 there are values like 45,08 in the results.
Please see full code and picture attached, also.

Sorting and filtering does not work for float values in my other application also.
It seems that sorting works for the first 100 values but after there are unsorted values. Formatting does not matter / help here.

Thanks and best regards
Michi

unit uMain;

interface

uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, VCL.TMSFNCTypes, VCL.TMSFNCUtils,
VCL.TMSFNCGraphics, VCL.TMSFNCGraphicsTypes, VCL.TMSFNCCustomControl,
VCL.TMSFNCDataGridBase, VCL.TMSFNCDataGrid;

type
TForm1 = class(TForm)
DG_1: TTMSFNCDataGrid;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var c :Integer;
begin
for c:=1 to 50 do DG_1.Floats[4,c]:=(Random(5000)/100);
end;
end.

Apparently, there was an issue in parsing numeric values when comparing them with conditions such as > or < . We have fixed this here, next version of TMS FNC Core will address this. Thanks for reporting

1 Like