Vultraz

Untitled

Jan 30th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. static std::string double_to_string_helper(double speed)
  2. {
  3.     std::string str = (formatter() << std::fixed << std::setprecision(2) << speed).str();
  4.  
  5.     str.erase ( str.find_last_not_of('0') + 1, std::string::npos );
  6.     str.erase ( str.find_last_not_of('.') + 1, std::string::npos );
  7.  
  8.     return str;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment