View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003867 | JEDI VCL | 00 JVCL Components | public | 2006-08-22 11:07 | 2006-09-01 02:57 |
Reporter | ConnectedText | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.20 | ||||
Target Version | Fixed in Version | 3.30 | |||
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. | ||||
Tags | No tags attached. | ||||
|
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 |
|
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. |
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 |