From baa40842ed4a3ce04bc2d26287d63a01a638e5fd Mon Sep 17 00:00:00 2001 From: Tyron Madlener Date: Tue, 26 Jul 2011 12:33:11 +0300 Subject: [PATCH] Better profiling durations formatting --- js/functions.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/functions.js b/js/functions.js index ff6eaa7b07..eca55470db 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1597,10 +1597,11 @@ function PMA_createProfilingChart(data, options) { // Formats a profiling duration nicely. Used in PMA_createProfilingChart() and server_status.js function PMA_prettyProfilingNum(num, acc) { - if(!acc) acc = 1; + if(!acc) acc = 2; acc = Math.pow(10,acc); - if(num*1000 < 0.1) num = Math.round(acc*(num*1000*1000))/acc + 'µ' - else if(num < 0.1) num = Math.round(acc*(num*1000))/acc + 'm' + if(num*1000 < 0.1) num = Math.round(acc*(num*1000*1000))/acc + 'µ'; + else if(num < 0.1) num = Math.round(acc*(num*1000))/acc + 'm'; + else num = Math.round(acc*num)/acc; return num + 's'; } -- 2.11.4.GIT