How to multiply this??

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

Why do we have to use decimal.multiply to multiply two intgers?
I just want to multiply these two values:

int oneThousand = 1000;
int watCHTimer1 = value from a textbox;

Thanks,
Trint
 
Trint!
Your posts are getting more and more stupid every day!
Try learning the language before trying to code (I hope you are not getting
paid for your "programming"! - I would like to see such a silly company that
pays such a "programmer" as you) Have you ever considered trying before
posting? This newsgroup is full of your dumb questions

Integer multiplication is done vie the awesome '*' operator

int trintsResult = 1000 * parsedValue;

Decimal.Multiply is used when we are multiplying two decimals.
I suggest you to try these great sites:
www.google.com
http://msdn.microsoft.com/
 
I knew that, but I keep getting an error in my app.
And you didn't have to respond if you were going to be rude.

..Net programmer
(e-mail address removed)
 
I had to respond because your questions are very, very often on this group
and most of the time, you are posting before trying to think about your
problem, before trying to find a solution and before using the debugger!
Try to google for an article "how to ask and get answers"
 
Hi Trint,

Try to convert the value from your textbox first

int YourValue = 5;
int TextValue = Convert.ToInt32(txtTextBox.Text);
or
int TextValue = ((IConvertible) txtTextBox.Text).ToInt32(null);

int Result = YourValue * TextValue;

Cheers
Salva
 
Back
Top