MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / valueToString

Function valueToString

source/MRViewer/MRUnits.cpp:476–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474
475template <UnitEnum E, detail::Units::Scalar T>
476std::string valueToString( T value, const UnitToStringParams<E>& params )
477{
478 // Convert to the target unit.
479 if ( unitsAreEquivalent( params.sourceUnit, params.targetUnit ) )
480 {
481 // This can be integral or floating-point.
482 return valueToStringImpl( value, params );
483 }
484 else
485 {
486 // This is always floating-point.
487 return valueToStringImpl( convertUnits( params.sourceUnit, params.targetUnit, value ), params );
488 }
489}
490
491#define MR_Y(T, E) template std::string valueToString<E, T>( T value, const UnitToStringParams<E>& params );
492#define MR_X(E) DETAIL_MR_UNIT_VALUE_TYPES(MR_Y, E)

Callers 1

valueToImGuiFormatStringFunction · 0.85

Calls 3

unitsAreEquivalentFunction · 0.85
valueToStringImplFunction · 0.85
convertUnitsFunction · 0.85

Tested by

no test coverage detected