Click here to Skip to main content
15,073,282 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
How to convert number like 40 to 0.4 in a textbox
Updated 17-Mar-21 11:28am
Sergey Alexandrovich Kryukov 14-Mar-14 13:15pm
Asking questions also requires some prerequisites. Not having successfully graduated from elementary school is not an option, sorry.
Mathiudi 14-Mar-14 13:25pm
Please don't be angry with me
Sergey Alexandrovich Kryukov 14-Mar-14 15:17pm
No, I'm not angry at all, why? hope you won't be angry, too. You need to learn by yourself and rely on yourself more.
Thank you for understanding.
Mathiudi 17-Mar-14 13:57pm
I'm a beginner and no one taught me how to use VB and I learn by my self with help of files on and the rest I found on the internet. so some of the thing that stack me up, I have to ask for help.

Just parse the number in the textbox to a double and divide it by 100:
Dim value As String = textBox1.Text
Dim num As Double
If Double.TryParse(value, num) Then
    Dim percentage As Double = num / 100
    textBox2.Text = percentage.ToString()
    ' cannot parse the given string to a double
End If
Divide the number by 100.

What's so hard about this?
Maciej Los 14-Mar-14 17:06pm
The best answer i've ever seen ;)
[no name] 15-Mar-14 4:11am
This answer has been accepted? I'm with SA.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900