Reputation: 1
I found a win, loss, percentage calculator in the forums. The form has a PLACE FOR INPUT
Team Braves
WINS = 96
LOSS 66
a button Compute Percentage and a text box it should read Braves won 59.259 percent of games. The program in the forums does not work. Does any one know how to do this? The math should be wins / wins+loss * 100. Pleas HELP This is in V B
Upvotes: 0
Views: 2314
Reputation: 826
If you're looking specifically for that format of number, Double.ToString() can format that for you:
Textbox.Text = ((wins / (wins + losses)) * 100).ToString("#0.###")
Upvotes: 1
Reputation: 22379
Aren't you forgetting the parentheses?
wins / (wins + losses) * 100
Upvotes: 3