ansiweather
ansiweather copied to clipboard
removed "-" sign when temp is 0, fixes issue #152
Tested with:
{"coord":{"lon":15.4306,"lat":40.9021},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"base":"stations","main":{"temp":-0.08,"feels_like":-2.89,"temp_min":-0.98,"temp_max":0.08,"pressure":1018,"humidity":76,"sea_level":1018,"grnd_level":945},"visibility":10000,"wind":{"speed":2.46,"deg":200,"gust":2.42},"clouds":{"all":19},"dt":1701061471,"sys":{"type":2,"id":2035784,"country":"IT","sunrise":1701064735,"sunset":1701099179},"timezone":3600,"id":3181187,"name":"Calitri","cod":200}
Before:
Fix:
Piped output to sed
to replace -0
with 0
After:
Noticed the same bug in feels_like
option. Applied the same fix.
Fixed #152
I happen to like the '-0' format. My home-made weather app indicates if the temperature is below zero. If its -0.5 it would be rounded to -1, but -0 means between 0 and -0.5, so its still below zero.
@Flapper01 I'm curious, why is it necessary to know if it's between 0 and -0.5. It seems odd to me to have '-0' displayed for a general user.