title: Spring @Value TypeMismatchException:Failed to convert value of type 'java.lang.String' to required type 'java.lang.Double'
body: <p>I want to use the @Value annotation to inject a Double property such as:</p>
  
  <pre><code>@Service
  public class MyService {
  
      @Value("${item.priceFactor}")
      private Double priceFactor = 0.1;
  
  // ...
  </code></pre>
  
  <p>and using Spring property placeholder (Properties files):</p>
  
  <pre><code>item.priceFactor=0.1
  </code></pre>
  
  <p>I get Exception: </p>
  
  <blockquote>
    <p>org.springframework.beans.TypeMismatchException: Failed to convert
    value of type 'java.lang.String' to required type 'java.lang.Double';
    nested exception is java.lang.NumberFormatException: For input string:
    "${item.priceFactor}"</p>
  </blockquote>
  
  <p>Is there a way to use a Double value coming from a properties file?</p>