martykan / forecastie

A simple, opensource weather app for Android.
Other
868 stars 335 forks source link

minus zero #607

Open acroobat opened 2 years ago

acroobat commented 2 years ago

Hello!

Program shows minus zero(-0). Everything is okay with widget.

Screenshot_20211024-091839_Forecastie

robinpaulson commented 2 years ago

My guess is a rounding bug. The temp is maybe -0.1, rounded to zero. Could you try enabling the display of decimal zeroes in the settings?

acroobat commented 2 years ago

Unfortunately temperature has already changed to positive. But enabling decimal zeroes seems to be a solution.

robinpaulson commented 2 years ago

I'm going to reopen this, I think it's a valid, if minor, bug. I'll assume my guess was correct and go from there. I can imagine it happening plenty of times all over the world, so it's worth looking into and fixing.

woheller69 commented 2 years ago

Here is a nice solution:

https://newbedev.com/negative-sign-in-case-of-zero-in-java