C# 数值计算

1.System.Globalization.NumberFormatInfo provider = new System.Globalization.NumberFormatInfo();

provider.NumberDecimalDigits = 1;

2. 计算应得分数,并按1位小数输出s

((TableCell)item.FindControl("averageGrade")).Text = (40 * (Convert.ToDouble(((TextBox)dltData.Items[item.ItemIndex].FindControl("TBoxKHF")).Text)/sumGrade*dltData.Items.Count)).ToString("F1");

你可能感兴趣的:(C#)