View Single Post
  #6 (permalink)  
Old 07-02-2008, 10:24 AM
Alan-LB's Avatar
Alan-LB Alan-LB is offline
Member
 
Join Date: Jun 2008
Location: Junee, NSW, Australia
Posts: 19
Alan-LB is on a distinguished road
Send a message via Yahoo to Alan-LB
You can use System.out.printf to format numbers. This would leave off the last few decimal positions.

System.out.printf("%10.5f\n", 1.8 + .09);

java(dot)sun(dot)com/j2se/1.5.0/docs/api/java/io/PrintStream.html#printf(java.lang.String,%20java.l ang.Object...)

Alan.
__________________
There are 10 types of people - those who understand binary and those who don't!!
Today is the Beta version of Tomorrow!!
Reply With Quote