我应该制作一个银行软件表单,允许用户创建账户并为任何账户进行存款和取款。但我不知道如何让它接受一个整数,一个小数点后面只有一个数字,或者一个小数点后面的第一个数字是 0。
Dim x As Decimal = Decimal.Parse(txtAmount.Text)
If (txtAmount.Text.IndexOf(".") <> -1 And txtAmount.Text.Substring(txtAmount.Text.IndexOf("." + 1)).Length > 2) Then
MessageBox.Show("No fractions of a penny")
Exit Sub
End If
Dim a As CAccount = lbxCustomers.SelectedItem
a.deposit(x)
有人知道我在做什么错吗?