![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Single source of truth for how chart plots render numeric values. More...
#include <QString>Go to the source code of this file.
Classes | |
| struct | openswmmvis::plot::NumberFormat |
| A mode + count describing how to render a double. More... | |
Namespaces | |
| namespace | openswmmvis |
| namespace | openswmmvis::plot |
Functions | |
| NumberFormat | openswmmvis::plot::numberFormatForPreset (int preset) |
| The mode + count a preset stands for. Out-of-range input falls back to two decimals, which is the historic default. | |
| int | openswmmvis::plot::presetForNumberFormat (NumberFormatMode mode, int count) |
| The preset that best represents mode + count. | |
Variables | |
| constexpr int | openswmmvis::plot::axisNumberFormatPresetCount = 17 |
| Number of presets; the valid range is [0, axisNumberFormatPresetCount). | |
Single source of truth for how chart plots render numeric values.
A NumberFormat pairs a mode (decimal places vs. significant figures) with a count and turns it into either a printf format string (for QValueAxis::setLabelFormat) or a formatted QString (for axis ticks drawn by hand, point labels, tooltips, cursor readouts, and stats panels). Every plot sources its format from here so the choice of ‘'f’/'g'and%.Nf/%.Ng` lives in exactly one place.
Significant figures are realised via printf g, which is the only sig-fig mechanism Qt's axis label format supports.