FUnitConversion

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/UnitConversion.h

Include

#include "Math/UnitConversion.h"

Syntax

struct FUnitConversion

Functions

Name Description

Public function Static

bool

 

AreUnitsCompatible

(
    EUnit From,
    EUnit To
)

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

Public function Static

EUnit

 

CalculateDisplayUnit

(
    T Value,
    EUnit InUnits
)

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

Public function Static

T

 

Convert

(
    T InValue,
    EUnit From,
    EUnit To
)

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

Public function Static

const TCHAR ...

 

GetUnitDisplayString

(
    EUnit Unit
)

Get the display string for the the specified unit type

Public function Static

EUnitType

 

GetUnitType

(
    EUnit
)

Get the type of the specified unit

Public function Static

bool

 

IsUnitOfType

(
    EUnit Unit,
    EUnitType Type
)

Check whether a unit is of the specified type

Public function Static

FNumericUnit...

 

QuantizeUnitsToBestFit

(
    T Value,
    EUnit Units
)

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

Public function Static

FUnitSetting...

 

Settings()

Get the global settings for unit conversion/display

Public function Static

TOptional< E...

 

UnitFromString

(
    const TCHAR* UnitString
)

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

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss