diff --git a/src/howler.core.js b/src/howler.core.js index 0219dce5..3f628735 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -1362,6 +1362,9 @@ lastTick = Date.now(); vol += diff * tick; + // Round to within 2 decimal points. + vol = Math.round(vol * 100) / 100; + // Make sure the volume is in the right bounds. if (diff < 0) { vol = Math.max(to, vol); @@ -1369,9 +1372,6 @@ vol = Math.min(to, vol); } - // Round to within 2 decimal points. - vol = Math.round(vol * 100) / 100; - // Change the volume. if (self._webAudio) { sound._volume = vol;