add a rounding helper

...as part of:
Breaking Change: adapt runtime.csv storage to improve readability
This commit is contained in:
Fischlurch 2022-04-23 18:57:47 +02:00
parent ef91088fb7
commit fda24faa73

View file

@ -59,6 +59,13 @@ constexpr auto array_from_tuple(TUP&& tuple)
return std::apply(makeArray, std::forward<TUP>(tuple));
}
template<size_t places>
inline double round(double val)
{
constexpr double shiftFac = pow(10.0,places);
return std::round(val * shiftFac)/shiftFac;
}