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>
diff --git a/tests/framework/Utils.h b/tests/framework/Utils.h
index 4f4b6fc..c0442cf 100644
--- a/tests/framework/Utils.h
+++ b/tests/framework/Utils.h
@@ -155,15 +155,17 @@
 
 /** 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();
 }