View Full Version : How to use Multiplication operator in Asp.net?
yawowcom001
05-19-2004, 04:16 AM
Thanks, yzarc
Even though I have changed variable declaration into "decimal", but in Internet Explorer, there is still error messge showing out:
The "*" can not using in Decimal or Double operation.
yawowcom001
05-19-2004, 11:33 AM
When I used the line in Asp.net, it doesn't work. I have been trid use "decimal operator *(decimal x, decimal y)" to solve the problem, but it still confused me.
Please give to an example on that, thanks.
int vat = (myCart.TotalCost(cartId) + 10) * 0.175;
yzarc
05-19-2004, 12:24 PM
I believe the problem is in your variable declaration.
multiplying by .175 will result in a decimal value, but you are assigning it to an int, without any type of conversion routine.
Greg
[b]quote:Originally posted by yawowcom001
When I used the line in Asp.net, it doesn't work. I have been trid use "decimal operator *(decimal x, decimal y)" to solve the problem, but it still confused me.
Please give to an example on that, thanks.
int vat = (myCart.TotalCost(cartId) + 10) * 0.175;
</blockquote id="quote"></font id="quote">
Greg Kelley
vBulletin® ©Jelsoft Enterprises Ltd.