TommyEvans
Active member
- Joined
- Feb 19, 2010
- Messages
- 39
- Programming Experience
- Beginner
Alright. I have a code that is dividing the users input.
I need it to multiply as usual, but then round it to .xx .
THEN, I need it to grab the number after .xx. For instance, .xxxx.
I need it to make the third and fourth x (a number of course)
and output into a seperate label. It will show instead of a decimal, it will show xx%.
For example. User divides 9846 by 12580.
You get .782670906200318.
It will first display .78 in one label.
And then 26% in another label.
BUT (of course). If the output is above .99 percent (1.xx), then it will show 1.xx (or whatever) in the first label, and the same as above in the second.
Here is the code I've got so far. I've got no idea how to do the above.
I need it to multiply as usual, but then round it to .xx .
THEN, I need it to grab the number after .xx. For instance, .xxxx.
I need it to make the third and fourth x (a number of course)
and output into a seperate label. It will show instead of a decimal, it will show xx%.
For example. User divides 9846 by 12580.
You get .782670906200318.
It will first display .78 in one label.
And then 26% in another label.
BUT (of course). If the output is above .99 percent (1.xx), then it will show 1.xx (or whatever) in the first label, and the same as above in the second.
Here is the code I've got so far. I've got no idea how to do the above.
VB.NET:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Kills As Integer
Dim Deaths As Integer
Kills = txtKills.Text
Deaths = txtDeaths.Text
lblOutput.Text = Kills / Deaths
End Sub