]> sigrok.org Git - pulseview.git/commitdiff
Util: Fix malformed time formatting
authorSoeren Apel <redacted>
Sun, 23 Aug 2015 12:20:59 +0000 (14:20 +0200)
committerUwe Hermann <redacted>
Tue, 25 Aug 2015 16:11:16 +0000 (18:11 +0200)
pv/util.cpp

index 133317e0b9d98b0b074d688f9919da3ce5f65df0..029ae079b64fcea1253bc66ed5fead8f7969f757 100644 (file)
@@ -119,7 +119,7 @@ static QString format_time_in_full(double t, signed precision, bool force_sign)
        if (precision >= 0) {
                ts << pad_number(seconds, use_padding ? 2 : 0);
 
-               const double fraction = fabs(t - whole_seconds);
+               const double fraction = fabs(t) - whole_seconds;
 
                if (precision > 0 && precision < 1000) {
                        QString fs = QString("%1").arg(fraction, -(2 + precision), 'f',