Sha256: 42a9f50c42253504889f1b81b75fd6e58dbf0aae4c59d722f27acc8ba3b17e59
Contents?: true
Size: 625 Bytes
Versions: 16
Compression:
Stored size: 625 Bytes
Contents
// // Copyright(c) 2015 Gabi Melman. // Distributed under the MIT License (http://opensource.org/licenses/MIT) // #pragma once #include <iomanip> #include <locale> #include <sstream> namespace utils { template<typename T> inline std::string format(const T &value) { static std::locale loc(""); std::stringstream ss; ss.imbue(loc); ss << value; return ss.str(); } template<> inline std::string format(const double &value) { static std::locale loc(""); std::stringstream ss; ss.imbue(loc); ss << std::fixed << std::setprecision(1) << value; return ss.str(); } } // namespace utils
Version data entries
16 entries across 16 versions & 1 rubygems