UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TNumericUnitTypeInterface< NumericType > Struct Template Reference

#include <NumericTypeInterface.h>

+ Inheritance diagram for TNumericUnitTypeInterface< NumericType >:

Public Member Functions

 TNumericUnitTypeInterface (EUnit InUnits)
 
virtual FString ToString (const NumericType &Value) const override
 
virtual TOptional< NumericType > FromString (const FString &ValueString, const NumericType &InExistingValue) override
 
virtual bool IsCharacterValid (TCHAR InChar) const override
 
void SetupFixedDisplay (const NumericType &InValue)
 
- Public Member Functions inherited from TDefaultNumericTypeInterface< NumericType >
virtual int32 GetMinFractionalDigits () const override
 
virtual int32 GetMaxFractionalDigits () const override
 
virtual bool GetIndicateNearlyInteger () const override
 
virtual void SetMinFractionalDigits (const TAttribute< TOptional< int32 > > &NewValue) override
 
virtual void SetMaxFractionalDigits (const TAttribute< TOptional< int32 > > &NewValue) override
 
virtual void SetIndicateNearlyInteger (const TAttribute< TOptional< bool > > &NewValue) override
 
- Public Member Functions inherited from INumericTypeInterface< NumericType >
virtual ~INumericTypeInterface ()
 
virtual FOnSettingChangedGetOnSettingChanged ()
 

Public Attributes

const EUnit UnderlyingUnits
 
TOptional< EUnitFixedDisplayUnits
 
TOptional< EUnitUserDisplayUnits
 
- Public Attributes inherited from TDefaultNumericTypeInterface< NumericType >
int16 MinFractionalDigits = DefaultMinFractionalDigits
 
int16 MaxFractionalDigits = DefaultMaxFractionalDigits
 
bool bIndicateNearlyInteger = false
 

Additional Inherited Members

- Static Public Attributes inherited from TDefaultNumericTypeInterface< NumericType >
static const int16 DefaultMinFractionalDigits = 1
 
static const int16 DefaultMaxFractionalDigits = 6
 
static const bool DefaultIndicateNearlyInteger = false
 

Detailed Description

template<typename NumericType>
struct TNumericUnitTypeInterface< NumericType >

Numeric interface that specifies how to interact with a number in a specific unit. Include NumericUnitTypeInterface.inl for symbol definitions.

Constructor & Destructor Documentation

◆ TNumericUnitTypeInterface()

template<typename NumericType >
TNumericUnitTypeInterface< NumericType >::TNumericUnitTypeInterface ( EUnit  InUnits)

Constructor

Member Function Documentation

◆ FromString()

template<typename NumericType >
TOptional< NumericType > TNumericUnitTypeInterface< NumericType >::FromString ( const FString &  ValueString,
const NumericType &  InExistingValue 
)
overridevirtual

Attempt to parse a numeral with our units from the specified string.

Reimplemented from TDefaultNumericTypeInterface< NumericType >.

◆ IsCharacterValid()

template<typename NumericType >
bool TNumericUnitTypeInterface< NumericType >::IsCharacterValid ( TCHAR  InChar) const
overridevirtual

Check whether the specified typed character is valid

Reimplemented from TDefaultNumericTypeInterface< NumericType >.

◆ SetupFixedDisplay()

template<typename NumericType >
void TNumericUnitTypeInterface< NumericType >::SetupFixedDisplay ( const NumericType &  InValue)

Set up this interface to use a fixed display unit, calculated based on the specified value. For example, if underlying units are cm/s, but the provided value is over 100, it will use m/s instead.

◆ ToString()

template<typename NumericType >
FString TNumericUnitTypeInterface< NumericType >::ToString ( const NumericType &  Value) const
overridevirtual

Convert this type to a string

Reimplemented from TDefaultNumericTypeInterface< NumericType >.

Member Data Documentation

◆ FixedDisplayUnits

template<typename NumericType >
TOptional<EUnit> TNumericUnitTypeInterface< NumericType >::FixedDisplayUnits

Optional units that this type interface will be fixed on. These are usually auto-calculated by SetupFixedDisplay.

◆ UnderlyingUnits

template<typename NumericType >
const EUnit TNumericUnitTypeInterface< NumericType >::UnderlyingUnits

The underlying units which the numeric type are specified in.

◆ UserDisplayUnits

template<typename NumericType >
TOptional<EUnit> TNumericUnitTypeInterface< NumericType >::UserDisplayUnits

Optional user-specified units that this type interface will be displayed in. If set, FixedDisplayUnits will be ignored.


The documentation for this struct was generated from the following files: