fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4.  
  5. int main()
  6. {
  7. double val = 643.1234567;
  8. std::stringstream str;
  9. str << std::fixed << val;
  10.  
  11. std::string tekst = str.str();
  12. std::cout << tekst;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0.02s 2816KB
stdin
Standard input is empty
stdout
643.123457