(fmt) Formatter.format("%.2g", 99.9) prints "10" instead of "1.0e+02"

XMLWordPrintable

    • b59
    • generic
    • solaris_8

      printf prints the wrong value in the following test case.

      class B {
          public static void main(String[] args) {
              System.out.printf("%.2g%n", 99.9);
          }
      }

            Assignee:
            Iris Clark
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: