A mode + count describing how to render a double.
More...
#include <numberformat.h>
|
| int | effectiveCount () const noexcept |
| | Effective, clamped digit count for the current mode.
|
| |
| char | fmtChar () const noexcept |
| | printf conversion the mode maps onto: 'f' (Decimals, Thousands), 'g' (SignificantFigures), 'e' (Scientific, Engineering).
|
| |
| bool | hasValidCustom () const |
| | True when custom is a single, safe floating-point printf conversion (specifier in eEfFgGaA, no '*' width/precision, no other conversions). Only then is custom honoured.
|
| |
| QString | printfSpec () const |
| | printf spec for QValueAxis::setLabelFormat — custom when valid, else e.g. "%.2f" / "%.3g".
|
| |
| QString | format (double v) const |
| | Format v for hand-drawn ticks, labels, tooltips, stats.
|
| |
A mode + count describing how to render a double.
◆ effectiveCount()
| int openswmmvis::plot::NumberFormat::effectiveCount |
( |
| ) |
const |
|
noexcept |
Effective, clamped digit count for the current mode.
◆ fmtChar()
| char openswmmvis::plot::NumberFormat::fmtChar |
( |
| ) |
const |
|
noexcept |
printf conversion the mode maps onto: 'f' (Decimals, Thousands), 'g' (SignificantFigures), 'e' (Scientific, Engineering).
◆ format()
| QString openswmmvis::plot::NumberFormat::format |
( |
double |
v | ) |
const |
Format v for hand-drawn ticks, labels, tooltips, stats.
◆ hasValidCustom()
| bool openswmmvis::plot::NumberFormat::hasValidCustom |
( |
| ) |
const |
True when custom is a single, safe floating-point printf conversion (specifier in eEfFgGaA, no '*' width/precision, no other conversions). Only then is custom honoured.
◆ printfSpec()
| QString openswmmvis::plot::NumberFormat::printfSpec |
( |
| ) |
const |
printf spec for QValueAxis::setLabelFormat — custom when valid, else e.g. "%.2f" / "%.3g".
◆ count
| int openswmmvis::plot::NumberFormat::count = 2 |
Decimals (>=0) or sig figs (>=1).
◆ custom
| QString openswmmvis::plot::NumberFormat::custom |
Optional user-supplied printf spec (e.g. "%.2f", "%.1f m"). When it holds a single valid floating-point conversion (see hasValidCustom()) it overrides mode/count; otherwise it is ignored and mode/count apply. Empty by default.
◆ mode
The documentation for this struct was generated from the following files: