Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed "-" sign when temp is 0, fixes issue #152 #153

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shahnewaz-labib
Copy link

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:
image

Fix:
Piped output to sed to replace -0 with 0

After:
image

@shahnewaz-labib shahnewaz-labib marked this pull request as draft November 27, 2023 05:39
@shahnewaz-labib
Copy link
Author

Noticed the same bug in feels_like option. Applied the same fix.

Fixed #152

@shahnewaz-labib shahnewaz-labib marked this pull request as ready for review November 27, 2023 05:42
@Flapper01
Copy link

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.

@shahnewaz-labib
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants