Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-801

Consider supporting negative scale for decimal type

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_OS
    • Fix Version/s: V4.0_ERRATA03
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Applied]

      Description

      (Relates to ODATA-771)

      ODATA-789 attempted to address a number of questions around the use of Edm.Decimal. Part of that was clarifying/correcting current semantics of Edm.Decimal, and was accepted at part of ODATA-789. Part of the issue discussed the addition of an exponential notation, which was already the topic of ODATA-771 and will be tracked there.

      This issue tracks the remaining issue from ODATA-789, the proposal to expand Edm.Decimal to support negative scale.

      Decimal data types in programming languages and databases
      ===============================================
      Common terminology is

      Value = Mantissa * 10**(-Scale)
      Precision = length of Mantissa

      Positive Scale means fractional digits, negative scale avoids representing "trailing zeroes" for large integers, e.g. one million has mantissa = 1, scale = -6

      Type Precision = length of mantissa Scale = -Exponent
      --------------------------------------------------------------------------------------------------------------------
      C# decimal 96 bit ~ 28-29 decimal digits Instance, 0...28
      Objective-C NSDecimalNumber 38 decimal digits Instance, -128...127
      Java BigDecimal unlimited no of decimal digits Instance, -2,147,483,648...2,147,483,647 (32 bit)
      DECFLOAT34 34 decimal digits Instance, -384...383
      DECFLOAT16 16 decimal digits Instance, -6144...6143
      DB2 DECIMAL 1...31 decimal digits Column, 0...Precision
      Sybase ASE DECIMAL 1...38 decimal digits Column, 0...Precision
      Sybase IQ DECIMAL 1...126 decimal digits Column, 0...Precision
      Postgres DECIMAL 1...1000 decimal digits Column, 0...Precision
      Oracle NUMBER 1...38 decimal digits Column, -84...127

      Problem when mapping NUMBER to Edm.Decimal

      • Scale cannot be negative or larger than Precision

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: