Check out example codes for "how to round to nearest whole number unity". It will help you in understanding the concepts better.

Code Example 1

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

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

        // Prints 11
        Debug.Log(Mathf.Round(10.7f));

Learn ReactJs, React Native from akashmittal.com