According to the
TablePlugin docs, data is only treated as numeric for sorting if it consists of digits plus an optional decimal point.
In particular, negative numbers are not sorted correctly:
%TABLE{sort="on" initsort="1"}%
| *number* |
| -1 |
| -10.1 |
| -9.99 |
| -2 |
| -2.0 |
| -20 |
produces:
number |
-20 |
-10.1 |
-9.99 |
-2 |
-2.0 |
-1 |
Is this behaviour intended?
--
TWiki:Main.BryanKitts
- 12 Mar 2010
Changing lib/TWiki/Plugins/TablePlugin/Core.pm line 536 to this seems to fix it:
elsif ( $text =~ /^\s*((-?[0-9]+)(\.([0-9]))?).*$/ ) {
--
TWiki:Main.BryanKitts
- 12 Mar 2010
Thank you Bryan for reporting the issue and for providing a patch. This is now in trunk and 4.3 branch, as well as new release at
TWiki:Plugins/TablePlugin
.
--
TWiki:Main.PeterThoeny
- 21 Mar 2010