Answers for "how to round to the nearest number unity"

C#
4

unity round

Mathf.Round(10.2f);
Posted by: Guest on February-21-2020
4

unity round float to nearest 10

//int
int sayi;
int = ((int)(((int)(sayi/10))*10));
//float
float sayi;
sayi = ((float)(((int)(sayi/10))*10));
Posted by: Guest on January-15-2021
0

how to round to nearest whole number unity

// Prints 10
        Debug.Log(Mathf.Round(10.0f));

        // Prints 10
        Debug.Log(Mathf.Round(10.2f));

        // Prints 11
        Debug.Log(Mathf.Round(10.7f));
Posted by: Guest on May-08-2020

Code answers related to "how to round to the nearest number unity"

C# Answers by Framework

Browse Popular Code Answers by Language