I have a
double variable as shown Below
double var1 = 0;
I Have a
Value = 123.25.
var1 += Math.Round(123.25), I am getting 123.0
So I need to get the Data Like as shown Below?
Output should be = 123
The problem isn't in the data - it's in the string conversion. There's no difference for a
So instead of focusing on the
Based on your question. If you only want the integer value why not have the Math.Round() result be assigned to a type int? That would get you what you want.
I cannot understand the reason you don't like the .0 at the end? If you print the variable holding 123.0 it shows up as 123. I can only see 123.0 when using debugger. How are you using the value? If you could tell us then we could find a better solution if none of the ones provided are of use to you.
I would strongly recommend that you read this: http://www.whathaveyoutried.com
If you follow the suggestions in that article, you will be able to get help in solving your problem in no time.
Your getting confused with the types. You don't want to use