We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab387eb commit b90d9c7Copy full SHA for b90d9c7
Cmfcmf/OpenWeatherMap/Util/Unit.php
@@ -81,7 +81,8 @@ public function __toString()
81
public function getUnit()
82
{
83
// Units are inconsistent. Only celsius and fahrenheit are not abbreviated. This check fixes that.
84
- if ($this->unit == 'celsius') {
+ // Also, the API started to return "metric" as temperature unit recently. Also fix that.
85
+ if ($this->unit == 'celsius' || $this->unit == 'metric') {
86
return "°C";
87
} else if ($this->unit == 'fahrenheit') {
88
return 'F';
0 commit comments