Answers for "how to display float value up to 2 decimal places in c"

C
4

show 2 decimals of float

// You can use .ToString("f2") to show 2 decimals of "f3" to show 3, etc.
float num = 123.24523;

Debug.Log(num.ToString("f2")); // Output: 123.24
Posted by: Guest on October-29-2021
1

int to float c

float percentage;
percentage = (float)number/total * 100;
Posted by: Guest on November-25-2020

Code answers related to "how to display float value up to 2 decimal places in c"

Code answers related to "C"

Browse Popular Code Answers by Language