namespace DataFile {
TextWriter::TextWriter(Output &o):
- WriterMode(o),
- float_format("%#.7g")
-{ }
+ WriterMode(o)
+{
+ float_format.showpoint().precision(7);
+}
void TextWriter::set_float_precision(unsigned fp)
{
- float_format = format("%%#.%dg", fp/4-1);
+ float_format.precision(fp/4-1);
}
void TextWriter::write(const Statement &st)
else if(i->get_signature()==IntType::signature)
out.write(lexical_cast<string>(i->get<IntType::Store>()));
else if(i->get_signature()==FloatType::signature)
- out.write(format(float_format, i->get<FloatType::Store>()));
+ out.write(lexical_cast<string>(i->get<FloatType::Store>(), float_format));
else if(i->get_signature()==SymbolType::signature)
{
string name = i->get<SymbolType::Store>().name;