Report: Use rounded values
[csit.git] / resources / tools / report_gen / run_improvments_tables.py
index 7bd6775..6b4953c 100755 (executable)
@@ -172,10 +172,11 @@ def main():
     for item in csv_data:
         mean, stdev = calculate_stats(item["rates"])
         if mean is not None:
-            mean = mean / 1000000
+            mean = float(mean) / 1000000
             old = float(item["last_old"])
             item["mean"] = mean
-            item["change"] = ((mean - old) / old) * 100
+            item["change"] = ((round(mean, 1) - round(old, 1)) / round(old, 1))\
+                             * 100
             item["stdev"] = stdev / 1000000
 
     # Sort the list, key = change

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.