Commit e720c196 authored by Mathieu Giraud's avatar Mathieu Giraud

core/tools.{h,cpp}: output_label_average, optional precision

parent ab1e8ea4
......@@ -257,7 +257,7 @@ double nChoosek(unsigned n, unsigned k)
return nChoosek_stored[n][k];
}
void output_label_average(ostream &out, string label, long long int nb, double average)
void output_label_average(ostream &out, string label, long long int nb, double average, int precision)
{
out << " ";
......@@ -267,7 +267,7 @@ void output_label_average(ostream &out, string label, long long int nb, double a
out << right << setw(9) << nb ;
out << " " << setw(5) ;
if (nb)
out << fixed << setprecision(1) << average ;
out << fixed << setprecision(precision) << average ;
else
out << "-" ;
}
......@@ -171,7 +171,7 @@ bool operator!=(const Sequence &s1, const Sequence &s2);
Outputs
***/
void output_label_average(ostream &out, string label, long long int nb, double average);
void output_label_average(ostream &out, string label, long long int nb, double average, int precision=1);
//////////////////////////////////////////////////
// Template code
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment