Better profiling durations formatting

This commit is contained in:
Tyron Madlener 2011-07-26 12:33:11 +03:00
parent 04613d5b1f
commit baa40842ed

View File

@ -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';
}