Open PragmaTwice opened 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.
percentOfPrecipitation
0.58
57%
Math.round
Pretty sure this will also fix the issue I'm seeing (the 28.99999999... value):
Can we get this CR merged please.
In this code, if
percentOfPrecipitation
is0.58
, the result string will be57%
. UsingMath.round
can solve this problem.