2. import java.text.DecimalFormat;   
3. import java.text.NumberFormat;   
4.   
5. public class TestFormatter {   
6.   
7.     public static void main(String[] args) {   
8.         String str = "0600450625465.5626";   
9.         TestFormatter t = new TestFormatter();   
10.         System.out.println(t.getFormatter(str));   
11.         System.out.println(t.getCurrency(str));   
12.         System.out.println(t.getDecimalFormat(str));   
13.     }   
14.   
15.     private String getFormatter(String str) {   
16.         NumberFormat n = NumberFormat.getNumberInstance();   
17.         double d;   
18.         String outStr = null;   
19.         try {   
20.              d = Double.parseDouble(str);   
21.              outStr = n.format(d);   
22.         } catch (Exception e) {   
23.             e.printStackTrace();   
24.         }   
25.         return outStr;   
26.     }   
27.        
28.     private String getDecimalFormat(String str){   
29.         DecimalFormat   fmt   =   new   DecimalFormat("##,###,###,###,##0.00000");     
30.         String outStr = null;   
31.         double d;   
32.         try {   
33.             d = Double.parseDouble(str);   
34.             outStr = fmt.format(d);   
35.         } catch (Exception e) {   
36.         }   
37.         return outStr;   
38.     }   
39.   
40.     private String getCurrency(String str) {   
41.         NumberFormat n = NumberFormat.getCurrencyInstance();   
42.         double d;   
43.         String outStr = null;   
44.         try {   
45.              d = Double.parseDouble(str);   
46.              outStr = n.format(d);   
47.         } catch (Exception e) {   
48.             e.printStackTrace();   
49.         }   
50.         return outStr;   
51.     }   
52. }