HTML: Fix sorting water and air temperature values

Parse values by float instead of integer.

Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com>
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Gehad elrobey 2014-08-11 17:20:34 +03:00 committed by Dirk Hohndel
parent ecf0408aae
commit 00a86b44ba

View file

@ -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_)