penguin-teal / gnome-openweather

A GNOME Shell extension to show the weather of any location on Earth.
GNU General Public License v3.0
58 stars 18 forks source link

Sometimes -0° appears as temperature #11

Closed furkansimsekli closed 8 months ago

furkansimsekli commented 8 months ago

Hey! Thanks for developing such great extension. I faced with an issue today, temperature was being showed as -0°. As you can guess it should have been only 0°. If it's not intentional, I assume there is a rounding from negative values but somehow "-" stays in the front? You can see the screenshot below:

image

I haven't had the chance to look at the codebase, but if it's an easy fix, I would like to contribute. If not, I can also help with translations in Turkish if needed.

penguin-teal commented 8 months ago

Thanks for the report, yeah it's what happens when you round something like -0.05 into a whole number. I agree that it should just read 0, in extensions.js in formatTemperature is where the problem would be. It should probably just say if the string is exactly "-0" then return "0". You can fix it if you want otherwise I can when I have time. Turkish translations would also be very helpful!