Last modified: 2009-01-31 22:01:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T17332, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 15332 - Sortable table with numeric in Italian
Sortable table with numeric in Italian
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
http://it.wikipedia.org/w/skins-1.5/c...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-26 23:48 UTC by poweruser
Modified: 2009-01-31 22:01 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description poweruser 2008-08-26 23:48:04 UTC
In Italy to separate thousands we use the space or the dot, and comma is the decimal separator.
The algorithm used to sort numbers in the sortable table in the file http://it.wikipedia.org/w/skins-1.5/common/wikibits.js doesn't support this standard.
I've updated the algorithm to solve this problem.
The line 621 should be changed from
   if (itm.match(/^[\d.,]+\%?$/))
to
   if (itm.match(/^[\d., \xA0]+\%?$/))

and the ts_parseFloat function should become
function ts_parseFloat(num) {
        if (!num) return 0;
        num = num.replace(/ /g, "");
        num = num.replace(/\xA0/g, "");
        num = num.replace(/\./g, "");
        num = num.replace(/,/g, ".");
        num = parseFloat(num);
        return (isNaN(num) ? 0 : num);
}

This method work only for the Italian standard and non for the english one.
Comment 1 poweruser 2008-08-26 23:51:00 UTC
More info in Italian at http://it.wikipedia.org/wiki/Wikipedia:Richieste_tecniche#Sortable
Comment 2 Niklas Laxström 2009-01-31 22:01:31 UTC
This should be fixed now when wgSeparatorTransformTable is used by javascript. Please test and reopen if the problem still happens.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links