//Take value from xTextBoxTotal and store it
Double Total = Convert.ToDouble(XButtonTotal.Text);
//Take value from xTextBoxRecieved and store it
double Recieved = Convert.ToDouble(xTextBoxRecieved.Text);
//Take value from xTextBoxTotal and subtract from amout recieved
double Amount = Total - Recieved;
//Take the Amount and store it in xTextBoxReturn
xTextBoxReturn.Text = Amount.ToString("C");
The xTexBoxTotal is in a currency format, Same as the XTextBoxReturn.Text.
The error I get when it gets to the xTextBolTotal is :
Double Total = Convert.ToDouble(XButtonTotal.Text); in yellow.
I assume I need to get the command that strips out the $, I thought that the convert.todouble did that.
Any help is apperciated.
I believe you would need to use a NumberStyles define to allow this, something like
You may need more than that, this should help
http://msdn.microsoft.com/en-us/library/system.globalization.numberstyles.aspx