use .toFixed(2) on volume decimals

This commit is contained in:
Araxeus
2021-05-16 23:50:59 +03:00
parent 28b70f6459
commit 9c7a70e056

View File

@ -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);