From 9c7a70e056d0f9f0de820027e3d8789907479c00 Mon Sep 17 00:00:00 2001 From: Araxeus Date: Sun, 16 May 2021 23:50:59 +0300 Subject: [PATCH] use `.toFixed(2)` on volume decimals --- plugins/precise-volume/front.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/precise-volume/front.js b/plugins/precise-volume/front.js index c8fb6a07..08231503 100644 --- a/plugins/precise-volume/front.js +++ b/plugins/precise-volume/front.js @@ -135,7 +135,7 @@ function changeVolume(toIncrease, options) { const steps = (options.steps || 1) / 100; videoStream.volume = toIncrease ? Math.min(videoStream.volume + steps, 1) : - Math.max(videoStream.volume - steps, 0); + Math.max(videoStream.volume - steps, 0).toFixed(2); // Save the new volume saveVolume(toPercent(videoStream.volume), options); @@ -156,7 +156,7 @@ function setupVolumeOverride(options) { video.addEventListener("canplay", () => { if (typeof options.savedVolume === "number") { - const newVolume = options.savedVolume / 100; + const newVolume = (options.savedVolume / 100).toFixed(2); video.volume = newVolume; updateVolumeSlider(options);