(C++) std::fixed

February 24, 2017 · View on GitHub

 

 

 

 

 

(C++) std::fixed

 

std::fixed is a stream manipulator to set the number of digits after the comma to a fixed number.

 


#include <iostream> int main() {   std::cout     << (1.0)     << '\n'     << std::fixed     << (1.0)     << '\n'; }

 

 

 

 

 

Examples

 

  • std::setprecision example 1: displaying a certain number of digits behind the comma

 

 

 

 

 

 

Contents

  1. 1int main() { std::cout #include &#x3C;iostream> int main() { std::cout &#x3C;&#x3C; (1.0) &#x3C;&#x3C; '\n' &#x3C;&#x3C; std::fixed &#x3C;&#x3C; (1.0) &#x3C;&#x3C; '\n'; }
  2. 2Examples