X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Futil.hpp;fp=pv%2Futil.hpp;h=f13516508aa45da7050a1aef0b9dd14f803e98af;hp=f75c95721d9df142691d2f44b12db2a7ca7895ea;hb=96b6316ab8ed24551a0affb7a5819d1c97147a5c;hpb=542f1e6c4ac755f5ef79b2c01e099ce69a1e8520 diff --git a/pv/util.hpp b/pv/util.hpp index f75c9572..f1351650 100644 --- a/pv/util.hpp +++ b/pv/util.hpp @@ -28,6 +28,11 @@ namespace pv { namespace util { +enum TimeUnit { + Time = 1, + Samples = 2 +}; + extern const int FirstSIPrefixPower; /** @@ -57,7 +62,8 @@ QString format_si_value( * @return The formated value. */ QString format_time( - double t, int prefix = -1, unsigned precision = 0, bool sign = true); + double t, int prefix = -1, TimeUnit unit = Time, unsigned precision = 0, + bool sign = true); /** * Formats a given time value with a SI prefix so that the