title: PHP: why !!"0.00" results in true
body: <p>I have a variable <code>$amount</code>, which sometimes can be <code>"0.00"</code>. Currently to check if this variable has value and if it's not zero following condition is being used: </p>
  
  <pre><code>if (!!$amount)
  </code></pre>
  
  <p>When <code>$amount</code> is <code>"0.00"</code> or <code>"0,00"</code> the condition is <code>true</code>, while it should be <code>false</code>. </p>
  
  <p>What is the most elegant way to make it <code>false</code>? I thought about using </p>
  
  <pre><code>if ($amount === "0.0" || $amount === "0,00")
  </code></pre>
  
  <p>and </p>
  
  <pre><code>if (!!floatval($amount))
  </code></pre>
  
  <p>but isn't there a better way?</p>
  
  <p>UPDATE: checked again and found out that <code>.</code> is a decimal separator, so it can't be "0,00".  </p>