這個函數不斷給我提出問題,我似乎找不到合適的組合來使它工作。如果達到一定數量,我正嘗試應用折扣,但我一直收到轉換錯誤。我需要做什麼以便我定義一切,以便它可以工作?從字符串「」轉換爲「雙精度型」無效
Function coupon() As Decimal
Dim decdiscount As Decimal
Dim inta, intb, intc As Decimal
inta = 20.0
intb = 40.0
intc = 60.0
If lblSubtotal.Text > inta Then
decdiscount = 0.05
End If
If lblSubtotal.Text > intb Then
decdiscount = 0.1
End If
If lblSubtotal.Text > intc Then
decdiscount = 0.2
End If
Return decdiscount
End Function
+1這也是我的答案 – 2012-04-26 12:08:38