I have a lot of data which i retrieve from the database and create a chart using those data (some of them are added)
One of the charts is displaying percentage and therefore i have to calculate my data to percent.
My boss has another program that also displays the percentage (but has no graph) and after making my program he came to me and said that the numbers in my table are wrong.
I looked it over my and found that the double (that is calculated into percentage) was the following number: 85.53178390026166
Apparently my program rounded this number up to 86.
Now my question is: Is there any way I can stop the program rounding doubles up unless it is .75 or closer? and instead in this example round-down to 85?
Well first of all notice that
85.53is CLOSER to86than it is to85. That being said, if you want it to only round up if it’s.75or greater, do:Example: