I have a problem trying to calculate a percentage.
I have a form with a maskedtextbox
with this format 00%
and a textbox
to enter a quantity and another to receive the calculation
textbox1 maskedtextbox resultado textbox1 textbox2
1000 * 10% = 100 + 1000 = 1100
The string does not have the correct format:
Dim precio, ganancia, resultado As Double
precio = Convert.ToDouble(txtpreciocompra.Text)
ganancia = Convert.ToDouble(txtganancia.Text) 'txtganancia es el maskedtextbox'
resultado = precio * ganancia / 100 +precio
txtprecioventa.Text = resultado.ToString