diff options
author | Giorgio Arena <giorgio.arena@arm.com> | 2017-10-31 17:59:17 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | ce58a9f8f8504c165ca4527bfd991a4029437cba (patch) | |
tree | c4360d11603912aa2e1915e5c25e42062218aaa5 /tests/framework/Utils.h | |
parent | 82afedf2598c8fc5a428ecbd729dd8204b46fd43 (diff) | |
download | ComputeLibrary-ce58a9f8f8504c165ca4527bfd991a4029437cba.tar.gz |
COMPMID-622 Let the user choose the units for the instruments
Change-Id: Ic6ac4cd6df6970593a5e2e6310b6d61951c88898
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/93887
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/framework/Utils.h')
-rw-r--r-- | tests/framework/Utils.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/framework/Utils.h b/tests/framework/Utils.h index 4f4b6fce56..c0442cf9af 100644 --- a/tests/framework/Utils.h +++ b/tests/framework/Utils.h @@ -155,15 +155,17 @@ inline std::string tolower(std::string string) /** Create a string with the arithmetic value in full precision. * - * @param val Arithmetic value + * @param val Arithmetic value + * @param decimal_places How many decimal places to show * * @return String with the arithmetic value. */ template <typename T, typename std::enable_if<std::is_arithmetic<T>::value, int>::type = 0> -inline std::string arithmetic_to_string(T val) +inline std::string arithmetic_to_string(T val, int decimal_places = 0) { std::stringstream ss; - ss.precision(std::numeric_limits<T>::digits10 + 1); + ss << std::fixed; + ss.precision((decimal_places) ? decimal_places : std::numeric_limits<T>::digits10 + 1); ss << val; return ss.str(); } |