diff --git a/Calendar/WeatherColumnDesign.py b/Calendar/WeatherColumnDesign.py index 45b54a5..8387e3e 100644 --- a/Calendar/WeatherColumnDesign.py +++ b/Calendar/WeatherColumnDesign.py @@ -31,6 +31,10 @@ class WeatherColumnDesign (DesignEntity): temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F")) humidity = forecast.air_humidity + "%" if self.forecast.units== "aviation": + if len(forecast.wind_deg)==1: + forecast.wind_deg = "00" + forecast.wind_deg + elif len(forecast.wind_deg)==2: + forecast.wind_deg = "0" + forecast.wind_deg if int(forecast.wind_speed)<10: windspeed = forecast.wind_deg + "@" + "0" + forecast.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit else: diff --git a/Calendar/WeatherHeaderDesign.py b/Calendar/WeatherHeaderDesign.py index eadcff8..f798843 100644 --- a/Calendar/WeatherHeaderDesign.py +++ b/Calendar/WeatherHeaderDesign.py @@ -30,6 +30,10 @@ class WeatherHeaderDesign (DesignEntity): temperature = cur_weather.air_temperature + " " + self.__get_unit__(("°C", "°F")) if units== "aviation": #pick up aviation + if len(forecast.wind_deg)==1: #if deg is 2, add two zeros for format + forecast.wind_deg = "00" + forecast.wind_deg + elif len(forecast.wind_deg)==2: + forecast.wind_deg = "0" + forecast.wind_deg if int(cur_weather.wind_speed)<10: windspeed = cur_weather.wind_deg + "@" + "0" + cur_weather.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit else: