UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FUnitConversion Struct Reference

#include <UnitConversion.h>

Static Public Member Functions

static CORE_API FUnitSettingsSettings ()
 
static CORE_API bool AreUnitsCompatible (EUnit From, EUnit To)
 
static CORE_API bool IsUnitOfType (EUnit Unit, EUnitType Type)
 
static CORE_API EUnitType GetUnitType (EUnit)
 
static CORE_API const TCHARGetUnitDisplayString (EUnit Unit)
 
static CORE_API TOptional< EUnitUnitFromString (const TCHAR *UnitString)
 
static CORE_API TConstArrayView< const TCHAR * > GetSupportedUnits ()
 
template<typename T >
staticConvert (T InValue, EUnit From, EUnit To)
 
template<typename T >
static FNumericUnit< T > QuantizeUnitsToBestFit (T Value, EUnit Units)
 
template<typename T >
static EUnit CalculateDisplayUnit (T Value, EUnit InUnits)
 

Member Function Documentation

◆ AreUnitsCompatible()

bool FUnitConversion::AreUnitsCompatible ( EUnit  From,
EUnit  To 
)
static

Check whether it is possible to convert a number between the two specified units

◆ CalculateDisplayUnit()

template<typename T >
EUnit FUnitConversion::CalculateDisplayUnit ( Value,
EUnit  InUnits 
)
static

Quantizes this number to the most appropriate unit for user friendly presentation (e.g. 1000m returns 1km), adhereing to global display settings.

◆ Convert()

template<typename T >
T FUnitConversion::Convert ( InValue,
EUnit  From,
EUnit  To 
)
static

Convert the specified number from one unit to another. Does nothing if the units are incompatible.

◆ GetSupportedUnits()

TConstArrayView< const TCHAR * > FUnitConversion::GetSupportedUnits ( )
static

Helper function to get all supported units

◆ GetUnitDisplayString()

const TCHAR * FUnitConversion::GetUnitDisplayString ( EUnit  Unit)
static

Get the display string for the the specified unit type

Get the unit abbreviation the specified unit type

◆ GetUnitType()

EUnitType FUnitConversion::GetUnitType ( EUnit  InUnit)
static

Get the type of the specified unit

◆ IsUnitOfType()

bool FUnitConversion::IsUnitOfType ( EUnit  Unit,
EUnitType  Type 
)
static

Check whether a unit is of the specified type

◆ QuantizeUnitsToBestFit()

template<typename T >
FNumericUnit< T > FUnitConversion::QuantizeUnitsToBestFit ( Value,
EUnit  Units 
)
static

Quantizes this number to the most appropriate unit for user friendly presentation (e.g. 1000m returns 1km).

◆ Settings()

FUnitSettings & FUnitConversion::Settings ( )
static

Get the global settings for unit conversion/display

◆ UnitFromString()

TOptional< EUnit > FUnitConversion::UnitFromString ( const TCHAR UnitString)
static

Helper function to find a unit from a string (name or display string)

Helper function to find a unit from a string (name or abbreviation)


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