long « decimal « Java Data Type Q&A

1. String with decimal to long?    forums.oracle.com

However in your case it might not work because that's a representation of a floating point number, even if the fractional part is zero. If toLong doesn't like it, I suppose you could strip everything after the dot, or convert it to a double and then convert the double to a long.