how to round the decimal value to next value even a decimal place exists

Posted by Shijohnjoseph under C# on 8/5/2012 | Points: 10 | Views : 850 | Status : [Member] | Replies : 1
Hi to all ,
i need to round the decimal value to next value even a decimal place exists

if the decimal value is 78.10
i want it to get 79 not 78
help me!..

"Personality has the power to open many doors, but character must keep them open"


Responses

Posted by: Gopesh9 on: 8/5/2012 [Member] Starter | Points: 25

Up
0
Down
You can write a function...

rounding(num)
{
double r = double.Parse(num);
double num1 = Math.Round(r);
if(num1 < r)
{
num1 += 1;
}
TextBox1.Text = num1.ToString();
}

G. S.
.Net Developer

Shijohnjoseph, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response