From 45eed0e3da9a630cdbb3766a08aa65988569b902 Mon Sep 17 00:00:00 2001 From: iasonmanolas Date: Fri, 18 Feb 2022 17:45:14 +0200 Subject: [PATCH] Moved string with precision function to Utilities namespace --- utilities.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utilities.hpp b/utilities.hpp index c0fee9a..6e752ff 100755 --- a/utilities.hpp +++ b/utilities.hpp @@ -142,6 +142,15 @@ struct Vector6d : public std::array { }; namespace Utilities { +template +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) { if (a.empty()) @@ -440,15 +449,6 @@ template std::string toString(const T &v) { std::to_string(v[2]) + ")"; } -template -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 size_t computeHashUnordered(const std::vector &v) {