mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 13:58:51 +03:00
Fix sorting by size in WebUI when non-default locale used.
This commit is contained in:
parent
1aa70bedb7
commit
7fce5ab268
1 changed files with 7 additions and 5 deletions
|
@ -80,13 +80,15 @@ var dynamicTable = new Class ({
|
||||||
var sizeStrToFloat = function(mystr) {
|
var sizeStrToFloat = function(mystr) {
|
||||||
var val1 = mystr.split(' ');
|
var val1 = mystr.split(' ');
|
||||||
var val1num = val1[0].toFloat()
|
var val1num = val1[0].toFloat()
|
||||||
var unit = val1[1].capitalize();
|
var unit = val1[1];
|
||||||
switch(unit[0]) {
|
switch(unit) {
|
||||||
case 'G':
|
case '_(TiB)':
|
||||||
|
return val1num*1099511627776;
|
||||||
|
case '_(GiB)':
|
||||||
return val1num*1073741824;
|
return val1num*1073741824;
|
||||||
case 'M':
|
case '_(MiB)':
|
||||||
return val1num*1048576;
|
return val1num*1048576;
|
||||||
case 'K':
|
case '_(KiB)':
|
||||||
return val1num*1024;
|
return val1num*1024;
|
||||||
default:
|
default:
|
||||||
return val1num;
|
return val1num;
|
||||||
|
|
Loading…
Reference in a new issue