+ 2
How to print 2 decimal places?
How to print 2 decimal places? E.g: 2.45 -> print 45 Sorry! I'm not so good at English.
2 Respostas
+ 3
Thank you very much!
+ 11
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double dbl = 3.1415926;
cout << fixed << setprecision(2) << dbl;
return 0;
}