title: HTMLMediaElement: The provided double value is non-finite
body: <p>Hello im trying to set a volume to a video!</p>
  
  <p>When i try to set the volume like this:</p>
  
  <pre><code>myVideoElement.volume = 0.801; // Is working fine!
  </code></pre>
  
  <p>But when i try to set the volume like this:</p>
  
  <pre><code>var volumeToSet = Math.floor(myPrcent * 10) / 1000;
  
  myVideoElement.volume = volumeToSet;
  </code></pre>
  
  <p>I get this error: </p>
  
  <p><a href="https://i.stack.imgur.com/qWpmc.png" rel="noreferrer"><img src="https://i.stack.imgur.com/qWpmc.png" alt="enter image description here"></a>
  How can fix that?</p>