"
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 9, 2015, 2:16 AM EDT
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