1
0
mirror of https://github.com/paboyle/Grid.git synced 2026-01-06 18:09:33 +00:00

more general implementation of the precision interface for serialisers

This commit is contained in:
2018-05-07 21:17:46 +01:00
parent 25828746f3
commit 54d789204f
2 changed files with 40 additions and 3 deletions

View File

@@ -103,8 +103,15 @@ namespace Grid
{
std::ostringstream os;
os.precision(16);
os << std::scientific << std::boolalpha << x;
if (getPrecision())
{
os.precision(getPrecision());
}
if (isScientific())
{
os << std::scientific;
}
os << std::boolalpha << x;
pugi::xml_node leaf = node_.append_child(s.c_str());
leaf.append_child(pugi::node_pcdata).set_value(os.str().c_str());
}