FGenericPlatformMath::RoundToInt

Converts a float to the nearest integer. Rounds up when the fraction is .5

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMath.h

Include

#include "GenericPlatform/GenericPlatformMath.h"

Syntax

static int32 RoundToInt
(
    float F
)

Remarks

Converts a float to the nearest integer. Rounds up when the fraction is .5

Returns

The nearest integer to 'F'.

Parameters

Parameter

Description

F

Floating point value to convert