Is there a built-in VB function to provide the following:
Dim price
Dim subsidy
if price - subsidy <= 0 then
price = 0
end if
In practical terms, I have many other things to calculate the price, so I want to simplify this:
Dim price = calculatedPrice - subsidy
and wrap it in some VB formatting, which ensures that if priceit ever becomes negative, it will be forced equal to zero.
I think a simple type conversion can do this, but I'm not sure which type suits.
source
share