* @brief Formats a double for tabular display (used in the cell text + the * data-sort-value attribute that drives the sortable table comparator). */
| 83 | * data-sort-value attribute that drives the sortable table comparator). |
| 84 | */ |
| 85 | static QString formatNumber(double v) |
| 86 | { |
| 87 | if (!std::isfinite(v)) |
| 88 | // code-verify off |
| 89 | return QStringLiteral("—"); |
| 90 | // code-verify on |
| 91 | |
| 92 | const double abs_v = std::fabs(v); |
| 93 | if (abs_v != 0.0 && (abs_v < 1.0e-3 || abs_v >= 1.0e6)) |
| 94 | return QString::number(v, 'e', 2); |
| 95 | |
| 96 | return QString::number(v, 'f', 3); |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * @brief Formats a millisecond duration as HH:MM:SS. |
no test coverage detected