C#的新手,并在第一次尝试使用Round方法时遇到此编译错误.有任何想法吗?谢谢:
private void totalPoundsTextBox_TextChanged(object sender, TextChangedEventArgs e)
{
TextBox textBox = textBoxes[1];
decimal numericValue = textBoxNumberCheck(textBox, 0M, 22046M,false);
if (numericValue >= 0)
***weight.Kilos = decimal.Round(numericValue / 2.2046M, 2, MidpointRounding.AwayFromZero);***
UpdateBoxValues();
}
Run Code Online (Sandbox Code Playgroud) c# ×1