Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@PragmaTwice
Copy link

@PragmaTwice PragmaTwice commented Mar 17, 2022

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
Copy link

jwierzbi commented Nov 2, 2022

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.

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