X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Futil.cpp;h=e3619829d1eab230cd0bda0b1b160fe5e7e404e5;hb=96b6316ab8ed24551a0affb7a5819d1c97147a5c;hp=2e54adeaed3dffae88cb2b7354ce9eb57395302b;hpb=e113edc6663092c278f6b79dd62faedc71f53e5b;p=pulseview.git diff --git a/pv/util.cpp b/pv/util.cpp index 2e54ade..e361982 100644 --- a/pv/util.cpp +++ b/pv/util.cpp @@ -52,7 +52,7 @@ QString format_si_value(double v, QString unit, int prefix, } assert(prefix >= 0); - assert(prefix < countof(SIPrefixes)); + assert(prefix < (int)countof(SIPrefixes)); const double multiplier = pow(10.0, (int)- prefix * 3 - FirstSIPrefixPower); @@ -67,10 +67,13 @@ QString format_si_value(double v, QString unit, int prefix, return s; } -QString format_time(double t, int prefix, +QString format_time(double t, int prefix, TimeUnit unit, unsigned int precision, bool sign) { - return format_si_value(t, "s", prefix, precision, sign); + if (unit == TimeUnit::Time) + return format_si_value(t, "s", prefix, precision, sign); + else + return format_si_value(t, "sa", prefix, precision, sign); } QString format_second(double second)