Import java.text. *; public class ut {private final static decimalformat nf = new decimalformat ("###, ## 0.00"); public static string formattomoney (String s) {if (s == null || s. Equals (")) {Return" 0.00 ";} Try {returnom (s));} catCH (Exception E) {Return S;}}
Public static string formattomoney (double d) {Return nf.format (d);} catCH (Exception E) {Return String.Valueof (d);}} public static void main (string [] args) {string DD = Client.formattomoney ("12345678990.78987"); System.out.Println (DD);
}