title: Validating decimals in symfony 2
body: <p>I have symfony2 entity mapped to a table using Doctrine. One of the properties is:</p>
  
  <pre><code>/**
   * @var decimal $price
   *
   * @ORM\Column(name="price", type="decimal", nullable=false)
   */
  private $price;
  </code></pre>
  
  <p>What <code>Assert</code> would satisfy my requirement that <code>$price</code> should be a valid decimal?</p>
  
  <p>If I stay things as-is then passing string <code>foo</code> as a decimal value will lead to validation error, while passing string <code>NaN</code> passes validation, because the string <code>NaN</code> is mapped as <code>float(NaN)</code> thus treated as a valid decimal value.</p>
  
  <p>Any workarounds?</p>
  
  <p>Symfony dev team assures it is not an issue: <a href="https://github.com/symfony/symfony/issues/3161" rel="nofollow">https://github.com/symfony/symfony/issues/3161</a></p>
  
  <p>Well, if it is not - then there is probably a solution to validate it. Any ideas?</p>