RealDocs

UKismetMathLibrary::Round

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPureUFUNCTION

Description

Rounds A to the nearest integer, rounding half-values away from zero (e.g. 1.5 → 2, -1.5 → -2). Returns an int32.

Caveats & Gotchas

  • The result is int32, so values outside the int32 range (-2,147,483,648 to 2,147,483,647) will overflow silently — use Round64 for large values.
  • Uses round-half-away-from-zero, not round-half-to-even (banker's rounding) — this can introduce small systematic bias when accumulating many rounded values.

Signature

static UE_INL_API int32 Round(double A);

Parameters

Name Type Description Default
A double The floating-point value to round.

Return Type

int32

Example

Round a float score to display C++
float RawScore = 87.6f;
int32 DisplayScore = UKismetMathLibrary::Round(RawScore); // 88

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.