pv::util::SIPrefix prefix,
pv::util::TimeUnit unit,
unsigned precision,
- bool sign,
- bool show_unit)
+ bool sign)
{
const unsigned limit = 60;
// If we have to use samples then we have no alternative formats
if (unit == pv::util::TimeUnit::Samples)
- return pv::util::format_time_si_adjusted(t, prefix, precision, show_unit ? "sa" : NULL, sign);
+ return pv::util::format_time_si_adjusted(t, prefix, precision, "sa", sign);
+
+ QString unit_string;
+ if (unit == pv::util::TimeUnit::Time)
+ unit_string = "s";
+ // Note: In case of pv::util::TimeUnit::None, unit_string remains empty
// View zoomed way out -> low precision (0), big distance (>=60s)
// -> DD:HH:MM
// View zoomed way in -> high precision (>3), low step size (<1s)
// -> HH:MM:SS.mmm... or xxxx (si unit) if less than limit seconds
if (abs(t) < limit)
- return pv::util::format_time_si_adjusted(t, prefix, precision, show_unit ? "s" : NULL, sign);
+ return pv::util::format_time_si_adjusted(t, prefix, precision, unit_string, sign);
else
return pv::util::format_time_minutes(t, precision, sign);
}