void set_precision (const string &key,
const unsigned int precision);
+ /**
+ * Sets the #scientific_flag#. True means
+ * scientific, false means fixed point
+ * notation.
+ */
+ void set_scientific (const string &key,
+ bool scientific);
+
/**
* Sets the caption of the column #key#
* for tex output. You may want to chose
*/
unsigned int precision;
+ /**
+ * #scientific#=false means fixed
+ * point notation.
+ */
+ bool scientific;
+
/**
* Flag that may be used by derived
* classes for arbitrary purposes.
#include <base/table_handler.h>
+#include <iostream>
#include <iomanip>
tex_caption(tex_caption),
tex_format("c"),
precision(4),
+ scientific(0),
flag(0)
{}
tex_caption(),
tex_format("c"),
precision(4),
+ scientific(0),
flag(0)
{}
+void TableHandler::set_scientific (const string &key,
+ bool scientific)
+{
+ Assert(columns.count(key), ExcColumnNotExistent(key));
+ columns[key].scientific=scientific;
+}
+
+
+
void TableHandler::write_text(ostream &out) const
{
vector<string> sel_columns;
const Column &column=col_iter->second;
out << setprecision(column.precision);
+
+ if (col_iter->second.scientific)
+ out.setf(ios::scientific, ios::floatfield);
+ else
+ out.setf(ios::fixed, ios::floatfield);
column.entries[i]->write_tex(out);
if (j<n_cols-1)
const Column &column=col_iter->second;
out << setprecision(column.precision);
+
+ if (col_iter->second.scientific)
+ out.setf(ios::scientific, ios::floatfield);
+ else
+ out.setf(ios::fixed, ios::floatfield);
+
column.entries[i]->write_tex(out);
if (j<n_cols-1)