add a rounding helper
...as part of: Breaking Change: adapt runtime.csv storage to improve readability
This commit is contained in:
parent
ef91088fb7
commit
fda24faa73
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue