From 527951b7bdea0aaebc2fd22cdc5f8a897391857d Mon Sep 17 00:00:00 2001 From: Wenzel Jakob <wenzel@inf.ethz.ch> Date: Tue, 22 Jul 2014 15:04:57 +0200 Subject: [PATCH] Fixed bug #292 (mathematica ignores the 'digits' parameter) -- patch contributed by Sidney Cadot --- src/films/mfilm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/films/mfilm.cpp b/src/films/mfilm.cpp index ca219932..701ac635 100644 --- a/src/films/mfilm.cpp +++ b/src/films/mfilm.cpp @@ -298,10 +298,12 @@ public: if (m_fileFormat == EMATLAB) { os << *ptr; } else { + /* Mathematica uses the peculiar '*^' notation rather than the standard 'e' notation. */ std::ostringstream oss; + oss << std::setprecision(m_digits); oss << *ptr; std::string str = oss.str(); - boost::replace_first(str, "e", " * 10^"); + boost::replace_first(str, "e", "*^"); os << str; }