Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1683

client-side convertNumber causes loss of precision

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 1.2.12-core
    • 1.2.15-core
    • Components
    • None

    Description

      ISSUE:
      ----------

      JS numbers are 64-bit values and thus only have 16 digits of precision; this isn't enough to represent the max value of a Long, BigInteger, or BigDecimal. This means that when we convert a number string to object then back to string on the client, we can lose precision, even though we wouldn't lose any precision on the server.

      FIX:


      Only render a client converter if the input value is bound to a supported type (Float, Double, Integer, Short, Byte). The JavaScript number is a 64-bit floating type and has enough precision to represent any of these supported types.

      Attachments

        1. maxPrecision_1.2.12.2.patch
          4 kB
          Cale Scholl
        2. maxPrecision_trunk.patch
          4 kB
          Cale Scholl

        Activity

          People

            gabrielle Gabrielle Crawford
            cale.scholl Cale Scholl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: