Chloe Allison
Chloe Allison

Reputation: 15

Error in Input string was not in a correct format

I'm getting the said error, help is appreciated thank you.

Dim GSTPrice As Double = Val(txtGst.Text / 100) * Val(txtSubTotal.Text)

Upvotes: 0

Views: 27

Answers (1)

Mudit Singh
Mudit Singh

Reputation: 195

I think you should use it like this:

Dim GSTPrice As Double = Val(txtGst.Text)/100 * Val(txtSubTotal.Text)

as txtGst.Text is a string you can not divide it by 100.

Upvotes: 1

Related Questions