#include <extdef.h>
-#include <assert.h>
-
+#include <cassert>
#include <algorithm>
#include <sstream>
#include <QTextStream>
#include <QDebug>
+using std::fixed;
+using std::max;
+using std::ostringstream;
+using std::setfill;
+using std::setprecision;
+using std::showpos;
+using std::string;
+
using namespace Qt;
namespace pv {
int precision = stream.realNumberPrecision();
- std::ostringstream ss;
- ss << std::fixed;
+ ostringstream ss;
+ ss << fixed;
if (stream.numberFlags() & QTextStream::ForceSign)
- ss << std::showpos;
+ ss << showpos;
if (0 == precision)
- ss << std::setprecision(1) << round(t);
+ ss << setprecision(1) << round(t);
else
- ss << std::setprecision(precision) << t;
+ ss << setprecision(precision) << t;
- std::string str(ss.str());
+ string str(ss.str());
if (0 == precision) {
// remove the separator and the unwanted decimal place
str.resize(str.size() - 2);
const unsigned int relative_prec =
(prefix >= SIPrefix::none) ? precision :
- std::max((int)(precision - prefix_order), 0);
+ max((int)(precision - prefix_order), 0);
return format_time_si(t, prefix, relative_prec, unit, sign);
}
const Timestamp fraction = fabs(t) - whole_seconds;
- std::ostringstream ss;
- ss
- << std::fixed
- << std::setprecision(precision)
- << std::setfill('0')
- << fraction;
- std::string fs = ss.str();
+ ostringstream ss;
+ ss << fixed << setprecision(precision) << setfill('0') << fraction;
+ string fs = ss.str();
// Copy all digits, inserting spaces as unit separators
for (int i = 1; i <= precision; i++) {