Converting a String that contains decimal to Long

The value 30000.1 is an invalid long value. You could parse the double value first:

lDurationMillis = (long)Double.parseDouble("30000.1");

Leave a Comment