小编Nig*_*ter的帖子

'decimal'不包含'Round'的定义

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#

3
推荐指数
1
解决办法
432
查看次数

标签 统计

c# ×1