martykan / forecastie

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

Fix percentage typo on precipitation #672

Open PragmaTwice opened 2 years ago

PragmaTwice commented 2 years ago
String.format(Locale.ENGLISH, "%d%%", (int) (percentOfPrecipitation * 100)

In this code, if percentOfPrecipitation is 0.58, the result string will be 57%. Using Math.round can solve this problem.

jwierzbi commented 1 year ago

Pretty sure this will also fix the issue I'm seeing (the 28.99999999... value):

Screenshot_20221028-105942

Can we get this CR merged please.