FNumericUnit is a numeric type that wraps the templated type, whilst a specified unit. 更多...
#include <UnitConversion.h>
Public 成员函数 | |
| TOptional< FNumericUnit< NumericType > > | ConvertTo (EUnit ToUnits) const |
| Convert this quantity to a different unit | |
| FNumericUnit () | |
| Constructors | |
| FNumericUnit (const FNumericUnit &Other) | |
| Copy construction/assignment from the same type | |
| template<typename OtherType > | |
| FNumericUnit (const FNumericUnit< OtherType > &Other) | |
| Templated Copy construction/assignment from differing numeric types. 更多... | |
| FNumericUnit< NumericType > | QuantizeUnitsToBestFit () const |
| Quantizes this number to the most appropriate unit for user friendly presentation (e.g. 更多... | |
静态 Public 成员函数 | |
| static TValueOrError< FNumericUnit< NumericType >, FText > | TryParseExpression (const TCHAR *InExpression, EUnit InDefaultUnit, const FNumericUnit< NumericType > &InExistingValue) |
| Try and parse an expression into a numeric unit | |
| static TOptional< FNumericUnit< NumericType > > | TryParseString (const TCHAR *InSource) |
| Parse a numeric unit from a string | |
Public 属性 | |
| const EUnit | Units |
| The associated units for the value. 更多... | |
| NumericType | Value |
| The numeric (scalar) value | |
FNumericUnit is a numeric type that wraps the templated type, whilst a specified unit.
It handles conversion to/from related units automatically. The units are considered not to contribute to the type's state, and as such should be considered immutable once set.
| FNumericUnit< NumericType >::FNumericUnit | ( | const FNumericUnit< OtherType > & | Other | ) |
Templated Copy construction/assignment from differing numeric types.
Relies on implicit conversion of the two numeric types.
| FNumericUnit< NumericType > FNumericUnit< NumericType >::QuantizeUnitsToBestFit | ( | ) | const |
Quantizes this number to the most appropriate unit for user friendly presentation (e.g.
1000m returns 1km).
| const EUnit FNumericUnit< NumericType >::Units |
The associated units for the value.
Can never change once set to anything other than EUnit::Unspecified.