this may be simple but im still new to this language.
I’m creating a windows application where is a text box and a a button. What it will do is take the value entered in the text box and create a .txt file with the value entered in the textbox as its content.
I’ve don this. I have successfully add “5” to the textbox and pressed the button and it will create a txt file with content “5” in it.
My question is, how do I format the value form the text box to something like this xxxxxxx.xxxxx?
So if I enter 5 how do I make it create in text to become 0000005.00000?
Or if I enter 5.4 how do i make it become like this 0000005.40000?
Can anyone shed a light? Or coding sample?
First of all, a text box gives you the value as a (text) string. If you want to process it further as a number (which you do), you first need to convert (parse) it. Then, you just format the number the way you want: