Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003867 [JEDI VCL] 00 JVCL Components minor always 2006-08-22 11:07 2006-09-01 02:57
Reporter ConnectedText View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version 3.20
Summary 0003867: Sorting in JvListView.
Description I have a small suggestion for JvListView.

If you add values with thousand separators to columns they are not ordered
correctly, even if you set to smNumeric or smCurrency. The problem lies
in the fact that StrToFloat do not accept thousand separators. To fix it is
only necessary to remove the thousand separator prior the conversion to
float in IsBigger function. It also makes function faster since no more
exceptions are raised when strings contains thousand separator.

            smNumeric:
              begin
                try
-> First := StrRemoveChars(First, [ThousandSeparator]);
-> Second := StrRemoveChars(Second, [ThousandSeparator]);

                  I := StrToFloat(First);
                  J := StrToFloat(Second);
                  Result := I > J;
                except
                  try
                    l := StrToInt64(First);
                  except
                    l := 0;
                  end;
                  try
                    m := StrToInt64(Second);
                  except
                    m := 0;
                  end;
                  Result := l > m;
                end;
              end;

The same is necessary in smCurrency case.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0010050)
obones (administrator)
2006-08-30 08:02

I'd rather use VarCyFromStr (see issue 0003494) to get the currency from a "locale" formatted value.
VarR8FromStr seems another good candidate for the conversion from string to float :

http://msdn.microsoft.com/library/en-us/automat/html/789b770a-2b8b-45b2-a572-73c207d31e3e.asp [^]
(0010051)
ConnectedText (reporter)
2006-08-30 11:02
edited on: 2006-08-30 11:03

I think VarCyFromStr could be used for the Currency case. I assume Numeric case applies only to strings with decimal and thousand separators. But any workable solution is welcome.


- Issue History
Date Modified Username Field Change
2006-08-22 11:07 ConnectedText New Issue
2006-08-24 10:43 hp Issue Monitored: hp
2006-08-30 08:02 obones Note Added: 0010050
2006-08-30 08:02 obones Status new => feedback
2006-08-30 11:02 ConnectedText Note Added: 0010051
2006-08-30 11:03 ConnectedText Note Edited: 0010051
2006-09-01 02:57 obones Status feedback => resolved
2006-09-01 02:57 obones Fixed in Version => Daily / SVN
2006-09-01 02:57 obones Resolution open => fixed
2006-09-01 02:57 obones Assigned To => obones


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker