title: batch file: arithmetic operations on decimal values
body: <p>I'm forced to use DOS to write some batch scripts. How to do arithmetic operations on variables? How to re-write the last line?</p>
  
  <pre><code>FOR %%f IN (*.ogg) DO CALL :runsox "%%f"
  del temp.ogg tmpfile
  GOTO :EOF
  
  :runsox
  soxi -D %1&gt;tmpfile
  
  SET /P decvalue=&lt;tmpfile * 1.2
  </code></pre>
  
  <p><strong>Update::</strong> Following bhu1st's post, I couldn't see exactly how to apply that to my script. But GNU bash has the same problem, cannot operate on floating point numbers. The way to solve this in bash is to calculate the value with an <strong>bc</strong>, a command line calculator. I download a <a href="http://download.cnet.com/Command-Line-Calculator/3000-2094_4-10897229.html" rel="nofollow">command line calculator</a>. and use as in the line:     </p>
  
  <pre><code>calcoo %decvalue%*1.2&gt;tmpfile
  </code></pre>