Skip to content

Commit

Permalink
Convert wind speed to km/h
Browse files Browse the repository at this point in the history
  • Loading branch information
azuwis committed Oct 16, 2017
1 parent a36b235 commit 3d0f33b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
$out .= 'Temp: '.$forecast->getTemperature().'°C\n';
$out .= 'Cond: '.$forecast->getSymbol().'\n';
$out .= 'Prec: '.$forecast->getPrecipitation().'mm\n';
$out .= 'Wind: '.$forecast->getWindSpeed().'m/s '.$forecast->getWindDirection().'\n';
$out .= 'Wind: '.round($forecast->getWindSpeed()*3.6).'km '.$forecast->getWindDirection().'\n';
$out .= '\n';

if ($temp_max < $forecast->getTemperature())
Expand All @@ -83,6 +83,7 @@
$precipitation += $forecast->getPrecipitation();
}
$out .= "\r\n";
$wind_max = round($wind_max * 3.6);

// my phone can fit 20 chars, my GoogleCalendar 19 chars:
// 1234567890123456789
Expand Down Expand Up @@ -111,7 +112,7 @@
}
}

$out .= "SUMMARY:${temp_max}|${temp_min}° {$precipitation}mm {$wind_max}m/s\r\n";
$out .= "SUMMARY:${temp_max}|${temp_min}° {$precipitation}mm {$wind_max}km\r\n";


$out .= "TRANSP:OPAQUE\r\n";
Expand Down

0 comments on commit 3d0f33b

Please sign in to comment.