Using set precision!

How would I get this:

Out of 1 million games you won: 493549
Out of 1 million games you lose: 506451
The probability for the Player to win is: 49%
the probability for House to win is: 50%

to show decimal numbers.

I have tried set precision and setw but it's not working.

Any help would be greatly appreciated
1
2
3
4
5
cout << "Out of 1 million games you won: " << number_of_wins << endl;
    cout << "Out of 1 million games you lose: " << number_of_lose << endl;
    cout << "The probability for the Player to win is: " << probability_of_winning << setprecision(5) << "%" << endl;
    cout << "the probability for House to win is: " << probability_of_losing << setprecision(5) << "%" << endl;
  
Oh, I didn't see that you opened a new topic for unanswered question, see http://www.cplusplus.com/forum/beginner/137857/#msg731295
Topic archived. No new replies allowed.