Hello everyone,
I am looking to round my float value to a single digit after decimal,not just to display,but to use in mathematical calculations.
Here is what i have so far:
The above code works,but i need to use an extra variable temp for typecasting purpose.
Is there a work around this??
Thanks,
AK
I am looking to round my float value to a single digit after decimal,not just to display,but to use in mathematical calculations.
Here is what i have so far:
Code:
float value = 5.65893 //example float
int temp = 0;
temp = value*10;
value = temp/10.00;
//value is 5.6
Is there a work around this??
Thanks,
AK