I'm trying convert value passed via text field to decimal and getting an error in doing so. I'm using vb .net trying to process gift certificates using web api. Any suggestions? Dim bal as decimal bal = Convert.ToDecimal(txtField.Text)
I'm trying convert value passed via text field to decimal and getting an error in doing so. I'm using vb .net trying to process gift certificates using web api. Any suggestions?
Dim bal as decimal
bal = Convert.ToDecimal(txtField.Text)
You can use Decimal.TryParse to see if the parse of the text data succeeds. Then handle both when it succeeds and fails.