ENH: stringOps: open OStringStream with fixed precision so floating point numbers get preserved

This commit is contained in:
mattijs
2011-06-29 09:56:51 +01:00
parent 9fa370f54a
commit 77077a83e5

View File

@ -328,6 +328,10 @@ Foam::string& Foam::stringOps::inplaceExpand
if (ePtr) if (ePtr)
{ {
OStringStream buf; OStringStream buf;
// Force floating point numbers to be printed with at least
// some decimal digits.
buf << fixed;
buf.precision(IOstream::defaultPrecision());
if (ePtr->isDict()) if (ePtr->isDict())
{ {
ePtr->dict().write(buf, false); ePtr->dict().write(buf, false);