diff --git a/oscar/tests/sessiontests.cpp b/oscar/tests/sessiontests.cpp index f5491d85..421e3a29 100644 --- a/oscar/tests/sessiontests.cpp +++ b/oscar/tests/sessiontests.cpp @@ -174,7 +174,14 @@ void SessionToYaml(QString filepath, Session* session) QList keys = session->settings.keys(); std::sort(keys.begin(), keys.end()); for (QList::iterator key = keys.begin(); key != keys.end(); key++) { - out << " " << settingChannel(*key) << ": " << session->settings[*key].toString() << endl; + QVariant & value = session->settings[*key]; + QString s; + if ((QMetaType::Type) value.type() == QMetaType::Float) { + s = QString::number(value.toFloat()); // Print the shortest accurate representation rather than QVariant's full precision. + } else { + s = value.toString(); + } + out << " " << settingChannel(*key) << ": " << s << endl; } out << " events:" << endl;