View Issue Details

IDProjectCategoryView StatusLast Update
0003867JEDI VCL00 JVCL Componentspublic2006-09-01 02:57
ReporterConnectedTextAssigned Toobones 
Status resolvedResolutionfixed 
Product Version3.20 
Target VersionFixed in Version3.30 
Summary0003867: Sorting in JvListView.
DescriptionI 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.

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

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

The same is necessary in smCurrency case.
TagsNo tags attached.



2006-08-30 08:02

administrator   ~0010050

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 :


2006-08-30 11:02

reporter   ~0010051

Last edited: 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-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