projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing default to switch/case block.
[pulseview.git]
/
pv
/
util.cpp
diff --git
a/pv/util.cpp
b/pv/util.cpp
index 28e0dfde50d2fb9230219c5bce3b18e58a70b2bc..a54bdcaf8f957e8df5b462b5594ef2842afae3e5 100644
(file)
--- a/
pv/util.cpp
+++ b/
pv/util.cpp
@@
-55,5
+55,18
@@
QString format_time(double t, unsigned int prefix,
return s;
}
return s;
}
+QString format_second(double second)
+{
+ unsigned int i = 0;
+ int exp = - FirstSIPrefixPower;
+
+ while ((second * pow(10.0, exp)) > 999.0 && i < countof(SIPrefixes) - 1) {
+ i++;
+ exp -= 3;
+ }
+
+ return format_time(second, i, 0, false);
+}
+
} // namespace util
} // namespace pv
} // namespace util
} // namespace pv