title: How to convert Optional Double to Double in javafx
body: <p>The following code if compiled gives the following error. How to solve this</p>
  
  <p><em>error: incompatible types: OptionalDouble cannot be converted to Double
                                           .average();</em></p>
  
  <pre><code>  Double todaypctpnl = openPositionsdata.stream()
                                       .mapToDouble(c-&gt;Double.parseDouble(c.getTodaypctpnl()))
                                       .average();
  </code></pre>