Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static std::string get_probability_string(const double prob)
- {
- std::ostringstream ss;
- if(prob > 0.9995) {
- ss << "100%";
- } else if(prob >= 0.1) {
- ss << std::setw(4) << std::setprecision(1) << 100.0 * prob << '%';
- } else {
- ss << std::setw(3) << std::setprecision(1) << 100.0 * prob << '%';
- }
- return ss.str();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement