# How do I multiply a number by pi

### Question

• Hey,
I'm currently programming a calculator application and I have found myself stuck on multiplying a number by the mathmatical value of PI.  The number shall be inputted in to a textbox1 and the result shall be shown in textbox2.  Does anyone have a solution to this?

regards Liam
Sunday, December 11, 2005 12:59 AM

• try System.Math.PI
that should help.
Sunday, December 11, 2005 2:37 AM

### All replies

• try System.Math.PI
that should help.
Sunday, December 11, 2005 2:37 AM
• Thanks,
I'm not that experianced would you mind putting it in example for me.  As I am not aware of how to use this sorry if this sounds a little lame.

regards Liam
Sunday, December 11, 2005 2:40 AM
• No problem. :)

That will multiply 10 and PI and put into variable answer.
Sunday, December 11, 2005 2:49 AM
• Thanks a lot Justin that worked just fine.
Sunday, December 11, 2005 2:51 AM
• I am also having problems showing the results of this calculation as I am retrieving the number to multiply from a textbox named textbox1.

What would be the best way to convert this and show my message in the same textbox removing the inputted number.

Regards Liam
Sunday, December 11, 2005 3:17 AM
Sunday, December 11, 2005 4:02 AM
• Still having problems converting.

I tried:
 mynumber = double.Parse(textBox1.Text);

But this also had problems implicitly converting.
Thanks a lot for all the help so far
regards Liam
Sunday, December 11, 2005 5:41 AM
• It's like this in C#:

mynumber = Convert.ToDouble(textBox1.Text);

Sunday, December 11, 2005 5:06 PM