Skip to content

Commit

Permalink
Sidebar: Do not show the ten-thousands-of-a-percent digit.
Browse files Browse the repository at this point in the history
Before this commit, a probability of 0.67% was shown as 0.67%.
Now it is shown as 0.7%.
(That's not a typo. I'm talking about a chance of 67 permyriad.)

Reproducible in the test scenario by having the Wolf Rider attack the
unit to its south.
  • Loading branch information
jostephd committed Sep 30, 2019
1 parent 967d979 commit 5672e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reports.cpp
Expand Up @@ -906,7 +906,7 @@ static std::string format_prob(double prob)
return "0%";
}
std::ostringstream res;
res << std::setprecision(prob < 0.1 ? 2 : 3) << 100.0 * prob << "%";
res << std::setprecision(prob < 0.01 ? 1 : prob < 0.1 ? 2 : 3) << 100.0 * prob << "%";
return res.str();
}

Expand Down

0 comments on commit 5672e1b

Please sign in to comment.