Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Thursday, October 21, 2010

Rounded off total income

Rounded off total income
       Int32 roundedAmt;  
Int32 torounded = Convert.ToInt32(lblTotalIncome.Text);
int lastdigit = torounded % 10;
if (lastdigit >= 5)
{
roundedAmt = torounded - lastdigit + 10;
}
else
{
roundedAmt = torounded - lastdigit;
}
lblRoundedOf.Text = Convert.ToString(roundedAmt);


Thanks & Regards
Santosh

No comments:

Post a Comment