mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
Weather script now rounds nearest integer.
This commit is contained in:
parent
fc154887f2
commit
0257ccd90a
1 changed files with 3 additions and 3 deletions
|
|
@ -37,10 +37,10 @@ data = json.loads(response.text)
|
|||
|
||||
condition = data["weather"][0]["main"]
|
||||
weather_icon = weather_icons[condition]
|
||||
temperature = f"{data['main']['temp']}°C"
|
||||
feels_like_temperature = f"{data['main']['feels_like']}°C"
|
||||
temperature = f"{round(data['main']['temp'])}°C"
|
||||
feels_like_temperature = f"{round(data['main']['feels_like'])}°C"
|
||||
humidity = f"{data['main']['humidity']}%"
|
||||
wind = f"{data['wind']['speed']}m/s {degrees_to_cardinal(data['wind']['deg'])}"
|
||||
wind = f"{round(data['wind']['speed'])}m/s {degrees_to_cardinal(data['wind']['deg'])}"
|
||||
|
||||
end_string = f"{weather_icon} {temperature} {feels_like_temperature} {humidity} {wind}"
|
||||
print(end_string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue