From 87d118e87c7bc63a8820c374c6720d220d9df299 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 26 Jan 2014 22:57:52 +0400 Subject: [PATCH] Fix WebUI sort by size/speed for some locales (with comma as decimal point). --- src/webui/scripts/dynamicTable.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/webui/scripts/dynamicTable.js b/src/webui/scripts/dynamicTable.js index 46b4eb38b..8fa51130a 100644 --- a/src/webui/scripts/dynamicTable.js +++ b/src/webui/scripts/dynamicTable.js @@ -79,8 +79,9 @@ var dynamicTable = new Class ({ case 8: // Down Speed var sizeStrToFloat = function(mystr) { var val1 = mystr.split(' '); - var val1num = val1[0].toFloat() - var unit = val1[1]; + val1[0] = val1[0].replace(",", "."); // toFloat() cannot parse comma as decimal point + var val1num = val1[0].toFloat(); + var unit = val1[1].split('/')[0]; // get an unit numerator only (to support speed values) switch(unit) { case '_(TiB)': return val1num*1099511627776;