"
out put is
6.66666666666667
i want only 2 decimal place is any one help me
how to get 2 decimal or 3 decimal places in above html comand
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vincent Maverick DuranoPosted May 9, 2015, 6:16 AM
You have to format the value first before you set it to the Label. For example:
double formatNum;
string num = "6.66666666666667";
if (double.TryParse(num, out formatNum)){
Label1.Text = formatNum.ToString("#,###.00");
}
You could also explore on Math.Round() method