Converting a String that contains decimal to Long
<p>I have following sample (<a href="http://ideone.com/qh3KB" rel="nofollow">link to ideone</a>). </p>

<pre><code>long lDurationMillis =  0;
lDurationMillis = Long.parseLong("30000.1");
System.out.print("Play Duration:" + lDurationMillis);
</code></pre>

<p>It throws an exception:</p>

<pre><code>Exception in thread "main" java.lang.NumberFormatException: For input string: "30000.1"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:419)
at java.lang.Long.parseLong(Long.java:468)
at Main.main(Main.java:9)
</code></pre>

<p>But why it wont let me convert that number to a string directly ?I can convert number to integer and than convert to double . But is there any other way ?</p>
