Fixed bug #292 (mathematica ignores the 'digits' parameter) -- patch contributed by Sidney Cadot

metadata
Wenzel Jakob 2014-07-22 15:04:57 +02:00
parent 6b0572bc90
commit 527951b7bd
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}