title: Convert $516.91 to 51691
body: <p>I have an input: 516.91. I need to convert it to 51691.</p>
  
  <p>I write a small test code but it doesn't work.</p>
  
  <p>Some examples:</p>
  
  <pre><code>56    -&gt; 5600
  56.1  -&gt; 5610
  56.13 -&gt; 5613
  100   -&gt; 10000
  </code></pre>
  
  <p>How to convert 516.91 to 51691 with PHP ?</p>
  
  <pre><code>&lt;?php
  
  $varA = 516.91;                                   
  
  $varB = intval(floatval($varA)*1000/10);
  
  
  $shouldBe = 51691;
  
  
  if ($varB == $shouldBe) {
      echo "OK";
  } else {
      echo "NOK - " . $varB . " != " . $shouldBe;
  }
  </code></pre>