double dec = (double)d * 45.00 / 1023.00;
In my application, there is a calcuation gives a double result.
I want to display it on a label. however, the lenght of the double value is too long...
How to set the precision of the double value to 3, such as 3.489 and ignore the other digits.
Is there any choice for the rule as "Smaller than 5, just ignore it; otherwise, add 1 to the last element of the value". I do not know how to explain it in English...
I think this should be a simple problem. However, I searched around and could not find a solution...
Any suggestion for searching such basic information
Thanks a lot!