Horje
round to float unity Code Example
round to float unity
float f = 3.16856f;
f = Mathf.Round(f * 10.0f) * 0.1f;
//Which will give 3.2f


//If you want 2 decimal points then,


float f = 3.16856f;
f = Mathf.Round(f * 100.0f) * 0.01f;
//Which results in 3.17f, and so on.




Csharp

Related
Linq - Random Elements Code Example Linq - Random Elements Code Example
unity how to change max fps Code Example unity how to change max fps Code Example
json ignore property c# Code Example json ignore property c# Code Example
how to reset rotation in unity Code Example how to reset rotation in unity Code Example
simple reset transform.rotation c# Code Example simple reset transform.rotation c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9