Answers for "unity math round doesnt go to decimal place"

C#
1

unity round to x decimals

using System;

int decimalPlaces = 4;
float number = 10.335577f;

Debug.Log(Math.Round(number, decimalPlaces));

//Output: 10.3356
Posted by: Guest on January-04-2022
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

Code answers related to "unity math round doesnt go to decimal place"

C# Answers by Framework

Browse Popular Code Answers by Language