User Tools

Site Tools


computer_science:programming:cpp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
computer_science:programming:cpp [2021/10/02 04:58] – [Formatting cout] manacomputer_science:programming:cpp [2021/10/02 04:59] (current) mana
Line 13: Line 13:
 Then get access to these: Then get access to these:
 <code cpp> <code cpp>
-cout << fixed << result << endl; // +cout << fixed << result << endl; // This will set the display to use fixed representation (default of 6 digits?)
 cout << fixed << setprecision(2) << result; // This will force cout to isplay only 2 decimals and will round to reach this result cout << fixed << setprecision(2) << result; // This will force cout to isplay only 2 decimals and will round to reach this result
 </code> </code>
computer_science/programming/cpp.1633118331.txt.gz · Last modified: 2021/10/02 04:58 by mana