Skip to content

Commit

Permalink
..and actually use the new conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jun 12, 2022
1 parent 767331f commit 77b1501
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/Horde/Service/Weather/Parser/Base.php
Expand Up @@ -30,6 +30,7 @@ abstract class Horde_Service_Weather_Parser_Base
const UNIT_KEY_SPEED = 'speed';
const UNIT_KEY_PRESSURE = 'pressure';
const UNIT_KEY_DISTANCE = 'distance';
const UNIT_KEY_HEIGHT = 'height';

/**
* The type of units to convert to.
Expand Down
8 changes: 6 additions & 2 deletions lib/Horde/Service/Weather/Parser/Metar.php
Expand Up @@ -290,7 +290,7 @@ protected function _parse(array $data)
$cloud['height'] = Horde_Service_Weather::convertDistance(
$result[4] * 100,
'ft',
$this->_unitMap[self::UNIT_KEY_DISTANCE]
$this->_unitMap[self::UNIT_KEY_HEIGHT]
);
}
} elseif (sizeof($result) == 6) {
Expand All @@ -302,7 +302,11 @@ protected function _parse(array $data)
if ($result[4] == '///') {
$cloud['height'] = Horde_Service_Weather_Translation::t('station level or below');
} else {
$cloud['height'] = $result[4] * 100;
$cloud['height'] = Horde_Service_Weather::convertDistance(
$result[4] * 100,
'ft',
$this->_unitMap[self::UNIT_KEY_HEIGHT]
);
}
} else {
// SKC or CLR or NSC
Expand Down

0 comments on commit 77b1501

Please sign in to comment.