Experts Exchange connects you with the people and services you need so you can get back to work.
Dim value As Integer = 50
Debug.WriteLine(FormatPercent(value / 100))
Open in new window
Function getValue(TextBox tb)
Dim percent As Double
'Cast String to double
percent = CDBL(tb.value)
IF( (percent/100) <= 1 and (percent/100) >= 0 )
getValue = percent
'invalid percentage value
Private Sub TextBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.Leave
If Integer.TryParse(Me.TextBox1.Text, New Integer) AndAlso Me.TextBox1.Text >= 0 AndAlso Me.TextBox1.Text <= 100 Then
Me.TextBox1.Text = FormatPercent(Me.TextBox1.Text / 100)
Me.TextBox1.Text = String.Empty
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.