Controls how a value with a unit is converted to a string. More...
#include <MRUnits.h>
Public Attributes | |
| std::string_view | decorationFormatString = "{}" |
| std::optional< E > | sourceUnit = getDefaultUnitParams<E>().sourceUnit |
| — Units: | |
| std::optional< E > | targetUnit = getDefaultUnitParams<E>().targetUnit |
The measurement unit of the resulting string. If null, no conversion is performed, and the unit name is taken from sourceUnit if any. | |
| bool | unitSuffix = getDefaultUnitParams<E>().unitSuffix |
| Whether to show the unit suffix. | |
| NumberStyle | style = getDefaultUnitParams<E>().style |
| — Precision: | |
| int | precision = getDefaultUnitParams<E>().precision |
| How many digits of precision. | |
| bool | plusSign = getDefaultUnitParams<E>().plusSign |
| — Other: | |
| ZeroMode | zeroMode = getDefaultUnitParams<E>().zeroMode |
| How to deal with zeroes. | |
| bool | unicodeMinusSign = getDefaultUnitParams<E>().unicodeMinusSign |
Use a pretty Unicode minus sign instead of the ASCII -. | |
| char | thousandsSeparator = getDefaultUnitParams<E>().thousandsSeparator |
| If non-zero, this character is inserted between every three digits to the left of the decimal point. | |
| char | thousandsSeparatorFrac = getDefaultUnitParams<E>().thousandsSeparatorFrac |
| If non-zero, this character is inserted between every three digits to the right of the decimal point. | |
| bool | leadingZero = getDefaultUnitParams<E>().leadingZero |
If false, remove zero before the fractional point (.5 instead of 0.5). | |
| bool | stripTrailingZeroes = getDefaultUnitParams<E>().stripTrailingZeroes |
| Remove trailing zeroes after the fractional point. If the point becomes the last symbol, remove the point too. | |
| std::conditional_t< std::is_same_v< E, AngleUnit >, DegreesMode, detail::Units::Empty > | degreesMode = getDefaultUnitParams<E>().degreesMode |
| When printing degrees, this lets you display arcminutes and possibly arcseconds. Ignored for everything else. | |
Friends | |
| bool | operator== (const UnitToStringParams &, const UnitToStringParams &)=default |
If you add new fields there, update the initializer for defaultUnitToStringParams in MRUnits.cpp. | |
Controls how a value with a unit is converted to a string.