+ 2
How do I select how many decimal places are displayed on my screen
I am writing a code in c++ to give tax and tip and I am using double but i only want it to display numbers in the tenths place how do I fix the problem I am having
1 Odpowiedź
+ 8
Use setprecision() function as follows :)
https://code.sololearn.com/cKY9zxKlRma2/#cpp
Edit: Another way using printf():
https://code.sololearn.com/cAO0mdqJR7Wp/#cpp