10 Replies Latest reply on Jan 10, 2007 6:46 PM by 807599

    problem converting double to string

      I try to fix double to format: ##.### in jTable but i have problem. In my country we use ,(comma) instead of . (point) and in jTable I need . (point) so i write sth like this to write numbers in jTable:
      double all = Double.parseDouble(s1.toString())+Double.parseDouble(s2.toString());
                        String fmt = "##.###";
                        String tmp = String.valueOf(all);
                        tmp = tmp.replaceAll(",",".");
                        System.out.println("TMP: "+tmp);
                        DecimalFormat df = new DecimalFormat(fmt);
                        all = Double.parseDouble(df.format(tmp));
      catch(java.lang.IllegalArgumentException xxx)
      where s1 and s2 are double with comma and all adding them.

      My problem is that when I trying to parse a double from "all" application catch exception.