Are there any built-in functions for custom rounding based on multiples? i.e., round to multiples of 0.5?
If you want to round to the nearest 1/x, where x is a positive integer.
float roundedValue = Mathf.Floor(initialValue * x) / x;
Are there any built-in functions for custom rounding based on multiples? i.e., round to multiples of 0.5?
If you want to round to the nearest 1/x, where x is a positive integer.
float roundedValue = Mathf.Floor(initialValue * x) / x;