Skip to content

Commit ccec7e4

Browse files
Michael Brookscmfcmf
authored andcommitted
Changed degree character to html representation, closes #15. Thanks @CheckeredMichael!
1 parent 8cf6da5 commit ccec7e4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cmfcmf/OpenWeatherMap/Forecast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct($xml, $units)
5050
$this->city = new City($xml->city['id'], $xml->city['name'], $xml->city->coord['lon'], $xml->city->coord['lat'], $xml->city->country);
5151

5252
if ($units == 'metric') {
53-
$temperatureUnit = "\xB0C";
53+
$temperatureUnit = "°C";
5454
} else {
5555
$temperatureUnit = 'F';
5656
}

Cmfcmf/OpenWeatherMap/Util/Unit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getUnit()
8383
{
8484
// Units are inconsistent. Only celsius and fahrenheit are not abbreviated. This check fixes that.
8585
if ($this->unit == 'celsius') {
86-
return "\xB0C";
86+
return "°C";
8787
} else if ($this->unit == 'fahrenheit') {
8888
return 'F';
8989
} else {

Cmfcmf/OpenWeatherMap/Util/UnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function testCelsiusFixture()
9898
{
9999
$this->givenThereIsAUnitWithUnit("celsius");
100100

101-
$this->assertSame("\xB0C", $this->unit->getUnit());
101+
$this->assertSame("°C", $this->unit->getUnit());
102102
}
103103

104104
public function testFahrenheitFixture()

0 commit comments

Comments
 (0)