MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / scaleBack

Function scaleBack

libs/datatables-binding-0.18/datatables.js:484–489  ·  view source on GitHub ↗
(x, scale)

Source from the content-addressed store, hash-verified

482 var scale = Math.pow(10, Math.max(0, +$x.data('scale') || 0));
483 r1 = Math.round(r1 * scale); r2 = Math.round(r2 * scale);
484 var scaleBack = function(x, scale) {
485 if (scale === 1) return x;
486 var d = Math.round(Math.log(scale) / Math.log(10));
487 // to avoid problems like 3.423/100 -> 0.034230000000000003
488 return (x / scale).toFixed(d);
489 };
490 var slider_min = function() {
491 return filter.noUiSlider('options').range.min;
492 };

Callers 2

formatDateFunction · 0.85
customFilterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected