0
我正在为我的开始c#类做这个项目,这里是我的代码。运行我的代码后,我得到“格式异常未处理”错误
private void inTextBox_Leave(object sender, EventArgs e){
const double inTextBox = 0.1;
double num = double.Parse(this.inTextBox.Text);
double doubledNum = num * inTextBox;
string outStr = $"{doubledNum:D}";
badTextBox.Text = outStr;
}
我试图让这个当我标签拖出我inTextBox的,它将计算假设吃饭时提出了一种基于与否良好的服务付小费金额。使用{doubledNum:F}
的[抛出一个格式异常C#]可能的复制(http://stackoverflow.com/questions/12550184/throw-a-format-exception-c-sharp) – CompuChip