added rounding to the wfm sidebar to make sure numbers arent too long
This commit is contained in:
@@ -33,9 +33,9 @@ var page_waveform = (function () {
|
||||
// Sidebar
|
||||
|
||||
$('#stat-count').html(j.stats.count);
|
||||
$('#stat-f-s').html(j.stats.freq);
|
||||
$('#stat-i-peak').html(peak);
|
||||
$('#stat-i-rms').html(j.stats.rms);
|
||||
$('#stat-f-s').html(numfmt(j.stats.freq, 2));
|
||||
$('#stat-i-peak').html(numfmt(peak, 2));
|
||||
$('#stat-i-rms').html(numfmt(j.stats.rms, 2));
|
||||
$('.stats').removeClass('invis');
|
||||
|
||||
// --- chart ---
|
||||
|
||||
@@ -2,6 +2,11 @@ function bool(x) {
|
||||
return (x === 1 || x === '1' || x === true || x === 'true');
|
||||
}
|
||||
|
||||
function numfmt(x, places) {
|
||||
var pow = Math.pow(10, places);
|
||||
return Math.round(x*pow) / pow;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform a substitution in the given string.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user