unity round to x decimals
Code Example - unity round to x decimals
using System;
int decimalPlaces = 4;
float number = 10.335577f;
Debug.Log(Math.Round(number, decimalPlaces));
//Output: 10.3356
using System;
int decimalPlaces = 4;
float number = 10.335577f;
Debug.Log(Math.Round(number, decimalPlaces));
//Output: 10.3356