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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
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