This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Thanks ........But...........
Posted by minesh Dhimmar on August 30, 2001 at 4:57 AM
> import java.text.* ; > > public class Test { > public static void main ( String[] args ) throws Exception { > DecimalFormat df = new DecimalFormat ( "###.##" ) ; > double d = 1.6667676 ; > System.out.println ( df.format ( d ) ) ; > } > > } Dear Sir, As u given a code I tested but I want some more flexible result in formating like if u get the data like if Double d=23.50; then it give output like 23.50 only not 23.5 as given by above code.Ok.. I have solved this proble using indexOf() and addition of string with some logic. But if any format is there then just gives help us. Okkk Thank u. Minesh Dhimmar
Replies:
|