I have a dollar amount brought into a textbox from another form that I want to have the retain dollar sign in the text box, but I need to take the number in a math formula after it is entered meaning I need to remove the dollar sign for the formula. This is the only place I use the number. I cant figure out what to do I have tried several things but so far none have worked. This is the area of the code I am having problems with:
public partial class LoanApp : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
LoanYearsTextBox.Text = Session["LoanYears"].ToString();
LoanAmountTextBox.Text = Session["TotalCost"].ToString();
ZipCodeTextBox.Text = Session["ZipCode"].ToString();
}
protected void LoanAmountTextBox.Text(object sender, TextChangedEventArgs e)
{
LoanAmountTextBox.Text = LoanAmountTextBox.Text.Replace("$", "");
LoanAmountTextBox.Select(LoanAmountTextBox.Text.Length, 0);
}
protected void CalcButton_Click(object sender, EventArgs e)
{
double Total = 0;
int ZipCode;
Total = double.Parse(LoanAmountTextBox.Text);
taxes = (Total * interest / term / 12);
MonthlyRate = (interest / 100 / 12);
term = (term * 12);
MonthlyPayment = (Total * (MonthlyRate / (1 - Math.Pow((1 + MonthlyRate), -term))));
}
Not all the code is in there.
Any help would be greatly appreciated.
This post has been edited by modi123_1: 14 February 2012 - 08:13 PM
Reason for edit:: fixed botched code tags

New Topic/Question
Reply



MultiQuote






|