From: Alexis Laferrière Date: Tue, 14 Nov 2017 16:47:50 +0000 (-0500) Subject: perf analysis: customize float precision in reports X-Git-Url: http://nitlanguage.org perf analysis: customize float precision in reports Signed-off-by: Alexis Laferrière --- diff --git a/lib/performance_analysis.nit b/lib/performance_analysis.nit index b9e436a..61f0186 100644 --- a/lib/performance_analysis.nit +++ b/lib/performance_analysis.nit @@ -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