How to round DOWN floats

Hi I know how to round doubles into floats then round floats using the code below but is there a way to basically only round down so if myDouble is 1.8374 it’ll go to 1 or if it’s 2.39284 then it’ll go to 2

myDouble = 3.82372;
myDoubleRounded = Mathf.Round((float)myDouble);

Use Mathf.Floor( a , b );

Yes, you can achieve this by using the Mathf.Floor function instead of Mathf.Round . Mathf.Floor rounds down to the nearest integer. YourTexasBenefits

If you want to round a double down to the nearest integer value, you can use Math.Floor() instead of Mathf.Round() . Here’s how you can do i

myDouble = 3.82372;
myDoubleRounded = (int)Math.Floor(myDouble);