Skip to content

Commit

Permalink
Changed degree character to html representation, closes #15. Thanks @…
Browse files Browse the repository at this point in the history
…CheckeredMichael!
Michael Brooks authored and cmfcmf committed Jun 18, 2014
1 parent 8cf6da5 commit ccec7e4
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cmfcmf/OpenWeatherMap/Forecast.php
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ public function __construct($xml, $units)
$this->city = new City($xml->city['id'], $xml->city['name'], $xml->city->coord['lon'], $xml->city->coord['lat'], $xml->city->country);

if ($units == 'metric') {
$temperatureUnit = "\xB0C";
$temperatureUnit = "°C";
} else {
$temperatureUnit = 'F';
}
2 changes: 1 addition & 1 deletion Cmfcmf/OpenWeatherMap/Util/Unit.php
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ public function getUnit()
{
// Units are inconsistent. Only celsius and fahrenheit are not abbreviated. This check fixes that.
if ($this->unit == 'celsius') {
return "\xB0C";
return "°C";
} else if ($this->unit == 'fahrenheit') {
return 'F';
} else {
2 changes: 1 addition & 1 deletion Cmfcmf/OpenWeatherMap/Util/UnitTest.php
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ public function testCelsiusFixture()
{
$this->givenThereIsAUnitWithUnit("celsius");

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

public function testFahrenheitFixture()

0 comments on commit ccec7e4

Please sign in to comment.