I dont want to round a float value I just want to cut down its length. So if I wanted to cut off the last 4 digits.
3.1231243 would be 3.123. Is this possible without rounding? I dont want to convert the float into a string.
Edit: Never mind figured it out
float val = 4.101814f;
float roundedVal = 0.01f * Mathf.Round(100.0f * val);
I thought you didn’t want to round it?
float truncatedVal = (int)(val * 1000) / 1000.0f;
–Eric