Answers for "unity round to one decimal"

C#
2

round to specific decimal unity

yourFloat.ToString("F2")
//in that case, if yourfloat is 204.242847247, it will return 204.24.
Posted by: Guest on August-29-2021
4

unity round float to nearest 10

//int
int sayi;
int = ((int)(((int)(sayi/10))*10));
//float
float sayi;
sayi = ((float)(((int)(sayi/10))*10));
Posted by: Guest on January-15-2021
3

unity round int

//int
int sayi = 0;
sayi = ((int)(((int)(sayi / 10)) * 10));
//float
float sayi;
sayi = ((float)(((int)(sayi/10))*10));
Posted by: Guest on January-15-2021

Code answers related to "unity round to one decimal"

C# Answers by Framework

Browse Popular Code Answers by Language