Skip to content

Commit

Permalink
[base] Increase precision for CSV output
Browse files Browse the repository at this point in the history
  • Loading branch information
ischoegl committed Jun 22, 2023
1 parent 222935c commit 2f8f798
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base/SolutionArray.cpp
Expand Up @@ -1048,7 +1048,8 @@ void SolutionArray::writeEntry(const string& fname, bool overwrite, const string
std::remove(fname.c_str());
}
std::ofstream output(fname);
output << header.str() << std::endl;
const auto default_precision = output.precision();
output << header.str() << std::endl << std::setprecision(9);

vector<double> buf(speciesNames.size(), 0.);
for (size_t row = 0; row < m_size; row++) {
Expand Down Expand Up @@ -1092,7 +1093,7 @@ void SolutionArray::writeEntry(const string& fname, bool overwrite, const string
}
output << std::endl;
}
output << std::endl;
output << std::endl << std::setprecision(default_precision);

if (escaped) {
warn_user("SolutionArray::writeEntry",
Expand Down

0 comments on commit 2f8f798

Please sign in to comment.