Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4663985

[Fmt-Nu] setParseIntegerOnly(true) is inconsistent when parsing percent amount

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 24
    • 1.4.0
    • core-libs
    • None
    • b04
    • generic
    • generic
    • Verified

      When running the attached program, I get this output:

      /java/re/jdk/1.4/archive/fcs/binaries/solsparc/bin/java SetParseIntegerOnlyForPercent
      java.text.ParseException: Unparseable number: "109.5%"
      1.09

      That is, calling the NumberFormat method setParseIntegerOnly() with TRUE and attempting to parse a percent amount with a fractional part throws a ParseException. However, parsing a percent amount with no fractional part does seem to work, even though I would have expected "1" (instead of "1.09") as the parse result.

            jlu Justin Lu
            jlueheorcl Jan Luehe (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: