Fix incorrect formatting of probabilities in the sidebar
This resulted from an incorrect use of std::setprecision, which sets the number of significant figures to display, not the number of decimal places.
This commit is contained in:
parent
b7790eb93f
commit
021ce76dca
1 changed files with 3 additions and 1 deletions
|
@ -844,9 +844,11 @@ static std::string format_prob(double prob)
|
|||
{
|
||||
if(prob > 0.9995) {
|
||||
return "100%";
|
||||
} else if(prob < 0.0005) {
|
||||
return "0%";
|
||||
}
|
||||
std::ostringstream res;
|
||||
res << std::setprecision(1) << std::setw(4) << 100.0 * prob << "%";
|
||||
res << std::setprecision(prob < 0.1 ? 2 : 3) << 100.0 * prob << "%";
|
||||
return res.str();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue