vt::runtime::component::detail::DiagnosticFormatter struct

Pretty-print a value with appropriately scaled units.

Public static functions

template<typename U>
static auto getValueWithUnits(U val, DiagnosticUnit unit, std::string default_spec, bool align) -> std::string
Format a value to a std::string with units.

Function documentation

template<typename U>
static std::string vt::runtime::component::detail::DiagnosticFormatter::getValueWithUnits(U val, DiagnosticUnit unit, std::string default_spec, bool align)

Format a value to a std::string with units.

Parameters
val in the value
unit in units for the value
default_spec in default fmt::format spec for outputting
align in whether to add alignment to value for table printing
Returns the pretty-printed std::string