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

[Fmt-Nu] DecimalFormat should support new subclasses of Number (AtomicInteger and AtomicLong)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • core-libs
    • None
    • b42
    • generic
    • generic

      DecimalFormat doesn't treat AtomicInteger and AtomicLong which are new subclasses of Number correctly.

      They are treated as double, therefore information may be lost for some numbers.
      For example, in ja_JA locale,
        format(new AtomicLong(Long.MAX_VALUE) prints 9,223,372,036,854,776,000
      while
        format(new Long(Long.MAX_VALUE) prints 9,223,372,036,854,775,807

      They should be supported as well as Integer and Long.

      ###@###.### 2005-06-01 04:18:15 GMT

            peytoia Yuka Kamiya (Inactive)
            peytoia Yuka Kamiya (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: