Hi,
I am trying to build a simple calculator to get x^y, I have found that the '^' symbol is not used in C# and I have to use 'Math.Pow' instead.
I have a form with 2 text boxes for input, an rtf box for output and a button for activating the function.
Here is my button function code:-
void Button1Click(object sender, EventArgs e)
{
string text1 = Box1.Text;
string text2 = Box2.Text;
int num1 = int.Parse(text1);
int num2 = int.Parse(text2);
Output.Text = Convert.ToString(System.Math.Pow(Convert.ToDouble(num1), Convert.ToDouble(num2)));
}
It all works fine but what I really need is to be able to display the exact number that is output, for example, 10^26 outputs as 1E+26.
My RTF box is very large, has word wrap set to true and has vertical scrollbars.
Any help would be appreciated.
Cheers..,
K