perf analysis: customize float precision in reports
authorAlexis Laferrière <alexis.laf@xymus.net>
Tue, 14 Nov 2017 16:47:50 +0000 (11:47 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 27 Nov 2017 23:57:25 +0000 (18:57 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/performance_analysis.nit

index b9e436a..61f0186 100644 (file)
@@ -60,9 +60,14 @@ class PerfMap
                return ts
        end
 
+       # Number of digits to the right of the decimal points in reports created by `to_s`
+       #
+       # Defaults to 4.
+       var precision = 4 is writable
+
        redef fun to_s
        do
-               var prec = 3
+               var prec = precision
 
                var table = new Map[String, Array[String]]
                for event, stats in self do