# trunc or round a float

**URL:** <https://forums.unrealengine.com/t/trunc-or-round-a-float/2175616>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [December 6, 2024, 5:08am UTC](https://forums.unrealengine.com/t/trunc-or-round-a-float/2175616 "2024-12-06T05:08:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [December 6, 2024, 5:08am UTC](https://forums.unrealengine.com/t/trunc-or-round-a-float/2175616/1 "2024-12-06T05:08:28Z")

</div>

hi

i want to round a float to 2 decimals

ie xxxx.xx

how would i do that

thanks

---

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [December 6, 2024, 5:15am UTC](https://forums.unrealengine.com/t/trunc-or-round-a-float/2175616/2 "2024-12-06T05:15:08Z")

</div>

found this now

> [@How to round a float to two decimals?](https://forums.unrealengine.com/t/how-to-round-a-float-to-two-decimals/457739/4):
>
> That doesn’t even work. It should and I can’t understand what the problem is but it still gives answers like 12.499998 and 30.100002
