DEV Community

Cover image for 🧡how to set precision in cpp for floating or double datatype 💪
aryan015
aryan015

Posted on

🧡how to set precision in cpp for floating or double datatype 💪

// a powerfull manipulative library for customized input/output
#include <iomanip> //input/output manipulatioin
float float_point = 2.000000;
cout<<fixed<<setprecision(2)<<float_point; //2.00
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
pauljlucas profile image
Paul J. Lucas

This shouldn't be tagged with #c, #javascript, or #python.

Collapse
 
aryan015 profile image
aryan015

ok