From 00a86b44ba97fa2fcee94c5840dcc7e2164dd5a6 Mon Sep 17 00:00:00 2001 From: Gehad elrobey Date: Mon, 11 Aug 2014 17:20:34 +0300 Subject: HTML: Fix sorting water and air temperature values Parse values by float instead of integer. Signed-off-by: Gehad elrobey Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- theme/list_lib.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'theme') diff --git a/theme/list_lib.js b/theme/list_lib.js index 348765bff..085d049c4 100644 --- a/theme/list_lib.js +++ b/theme/list_lib.js @@ -401,22 +401,22 @@ function cmpDateDes(j, iSmaller) function cmpAtempAsc(j, iSmaller) { - return parseInt(items[j].temperature.air, 10) < parseInt(items[iSmaller].temperature.air, 10); + return parseFloat(items[j].temperature.air, 10) < parseFloat(items[iSmaller].temperature.air, 10); } function cmpAtempDes(j, iSmaller) { - return parseInt(items[j].temperature.air, 10) > parseInt(items[iSmaller].temperature.air, 10); + return parseFloat(items[j].temperature.air, 10) > parseFloat(items[iSmaller].temperature.air, 10); } function cmpWtempAsc(j, iSmaller) { - return parseInt(items[j].temperature.water, 10) < parseInt(items[iSmaller].temperature.water, 10); + return parseFloat(items[j].temperature.water, 10) < parseFloat(items[iSmaller].temperature.water, 10); } function cmpWtempDes(j, iSmaller) { - return parseInt(items[j].temperature.water, 10) > parseInt(items[iSmaller].temperature.water, 10); + return parseFloat(items[j].temperature.water, 10) > parseFloat(items[iSmaller].temperature.water, 10); } function sort_it(sortOn, function_) -- cgit v1.2.3-70-g09d2