这个功能一直给我带来问题,我似乎找不到合适的组合来让它工作。如果达到一定金额,我正在尝试应用折扣,但我不断收到转换错误。我需要做什么才能定义所有内容以使其正常工作?
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