Moved string with precision function to Utilities namespace
This commit is contained in:
parent
bef2ae8860
commit
45eed0e3da
|
|
@ -142,6 +142,15 @@ struct Vector6d : public std::array<double, 6> {
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Utilities {
|
namespace Utilities {
|
||||||
|
template<typename T>
|
||||||
|
std::string to_string_with_precision(const T a_value, const int n = 2)
|
||||||
|
{
|
||||||
|
std::ostringstream out;
|
||||||
|
out.precision(n);
|
||||||
|
out << std::fixed << a_value;
|
||||||
|
return out.str();
|
||||||
|
}
|
||||||
|
|
||||||
inline bool compareNat(const std::string &a, const std::string &b)
|
inline bool compareNat(const std::string &a, const std::string &b)
|
||||||
{
|
{
|
||||||
if (a.empty())
|
if (a.empty())
|
||||||
|
|
@ -440,15 +449,6 @@ template <typename T> std::string toString(const T &v) {
|
||||||
std::to_string(v[2]) + ")";
|
std::to_string(v[2]) + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
std::string to_string_with_precision(const T a_value, const int n = 2)
|
|
||||||
{
|
|
||||||
std::ostringstream out;
|
|
||||||
out.precision(n);
|
|
||||||
out << std::fixed << a_value;
|
|
||||||
return out.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
size_t computeHashUnordered(const std::vector<T> &v)
|
size_t computeHashUnordered(const std::vector<T> &v)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue