Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Double.parseDouble help?

843789Jul 13 2010 — edited Jul 14 2010
I have this String Number 20.000. When I do a parseDouble I get 20.0 which is right.
public class qwerty {
	public static void main(String[] args) {
		String num = "20.000";
		System.out.println(Double.parseDouble(num));
	}
}
But is there a way to preserve the zeroes and it prints 20.000 itself after parse Double?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2010
Added on Jul 13 2010
11 comments
390 views