Hello
I'm new to this C# programming and I have an assignment to do. We are creating an Amortization Report in Visual Basic 2010.
So far I have three input boxes (Principal, Interest Rate, and Term) and a Submit button. I have to convert those three input boxes to double types. How in the world do I do that? Please help.. Here's my code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Amorization_Schedule
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// This is the Principal : text. Not the textbox.
private void label1_Click(object sender, EventArgs e)
{
}
// This is the Interest Rate :. Not the textbox.
private void Rate_Click(object sender, EventArgs e)
{
}
// This is the Term: . Not the textbox for it.
private void Term_Click(object sender, EventArgs e)
{
}
// This is the Principal textbox. This is where you put principal amount.
private void principaltxt_TextChanged(object sender, EventArgs e)
{
}
// This is the Interest Rate textbox. Put the rate of your interest here.
private void txtrate_TextChanged(object sender, EventArgs e)
{
}
// This is the Term textbox. The terms of your loan.
private void txtterm_TextChanged(object sender, EventArgs e)
{
}
// This is the Submit button.
private void btnsubmit_Click(object sender, EventArgs e)
{
double Rate = Convert.ToDouble(txtrate.Text);
double principal = Convert.ToDouble(txtprincipal.Text);
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void label1_Click_1(object sender, EventArgs e)
{
}
}
}
|
FroglegPosted Jan 24, 2011, 1:19 AM
Bryian TanPosted Jan 23, 2011, 11:05 PM
I see you converting it to double in your code. What exactly is the problem?
Convert.ToDouble(txtprincipal.Text);
dhru patelPosted Jan 23, 2011, 8:46 PM
FroglegPosted Jan 23, 2011, 2:37 PM
http://www.amortization-calc.com/