Need to round float to one decimal point. Why is it so difficult?

Lowenfas
Fri, 07 Apr 2023 00:09:59 +0000
Blueprint

I just need to round a float to one decimal point but nothing is working. The most common response is to multiply my number by 10, floor it into an integer, then divide it by 10 again to turn it back into a float. It doesn’t work.

I keep ending up with results like 2.100002 or 8.699998
Numbers that end in .0 or .5 work properly but everything else is off by .000002 and I can’t figure out why.

Even the ‘Snap to grid’ node doesn’t work, it has the exact same result as the problem above only it can be off by up to .000005

This should be so simple and there are sooooo many people out there trying to do this same type of thing so why doesn’t Unreal still not have a node for this!?

10 posts - 8 participants