-1

I have a little math issue I have stumbling around on. Hoping someone can help with it.

label3.text needs to be textbox1.text * 100 and that product needs to be divided by the quotient of (1000000/textbox7.text)

`label3.Text = (Convert.ToDouble(textBox1.Text) * 100 / (1000000 / (textBox7.Text).ToString("N3"));`
Masoud Andalibi
  • 3,168
  • 5
  • 18
  • 44
Rick
  • 41
  • 6

1 Answers1

4

You can't divide by textBox7.Text (which is string) but by double:

label3.Text = (Convert.ToDouble(textBox1.Text) * 100 / 
              (1000000 / Convert.ToDouble(textBox7.Text))).ToString("N3");

Please, notice that .ToString("N3") should be the very last method (= the value we've obtain represent in N3 format)

Dmitry Bychenko
  • 180,369
  • 20
  • 160
  • 215