From 0145ee4bef637f163902d05ae6559decf3887e5c Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Wed, 10 Apr 2019 01:27:56 +0300 Subject: [PATCH] Fix OWM always returning preciption in mm --- routes/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/weather.js b/routes/weather.js index 0e1fcc7..91ea7a9 100755 --- a/routes/weather.js +++ b/routes/weather.js @@ -70,7 +70,7 @@ function getOWMWeatherData( location, callback ) { weather.maxTemp = parseInt( data.list[ 0 ].temp.max ); weather.humidity = parseInt( data.list[ 0 ].humidity ); weather.wind = parseInt( data.list[ 0 ].speed ); - weather.precip = data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain || 0 ) : 0; + weather.precip = ( data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain || 0 ) : 0 ) / 25.4; weather.description = data.list[ 0 ].weather[ 0 ].description; weather.icon = data.list[ 0 ].weather[ 0 ].icon; weather.forecast = [];