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

6.2.4 Attribute Scale: clarify allowed range of Scale values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS02
    • Fix Version/s: V4.0_ERRATA01
    • Component/s: CSDL XML
    • Labels:
      None
    • Environment:

      [Applied]

    • Proposal:
      Hide

      Change text to

      A decimal property MAY define a non-negative integer value or the value variable for the Scale attribute.
      This attribute specifies the maximum number of digits allowed to the right of the decimal point.
      The value variable means that the number of digits to the right of the decimal point may vary from zero to the value of the Precision attribute minus one (at least one digit is required to the left of the decimal point).
      An integer value means that the number of digits to the right of the decimal point may vary from zero to the value of the Scale attribute, and the number of digits to the left of the decimal point may vary from one to the value of the Precision attribute minus the value of the Scale attribute.
      The value of the Scale attribute MUST be less than the value of the Precision attribute.

      Examples:
      <Property Name="Amount" Precision="3" Scale="2" />
      allowed Values: 1.23, 0.23, 3.14, 0.7
      not allowed values: 123, 12.3

      <Property Name="Amount" Precision="2" Scale="2" />
      not allowed, because .23 is not allowed anymore and 0.23 needs precision 3

      <Property Name="Amount" Precision="3" Scale="variable" />
      allowed Values: 1.23, 0.23, 0.7, 123, 12.3
      not allowed values: 12.34, 1234, 123.4

      Accepted: https://www.oasis-open.org/committees/download.php/52637/odata-meeting-69_on-20140327-minutes.html#odata-566

      Show
      Change text to A decimal property MAY define a non-negative integer value or the value variable for the Scale attribute. This attribute specifies the maximum number of digits allowed to the right of the decimal point. The value variable means that the number of digits to the right of the decimal point may vary from zero to the value of the Precision attribute minus one (at least one digit is required to the left of the decimal point). An integer value means that the number of digits to the right of the decimal point may vary from zero to the value of the Scale attribute, and the number of digits to the left of the decimal point may vary from one to the value of the Precision attribute minus the value of the Scale attribute. The value of the Scale attribute MUST be less than the value of the Precision attribute. Examples: <Property Name="Amount" Precision="3" Scale="2" /> allowed Values: 1.23, 0.23, 3.14, 0.7 not allowed values: 123, 12.3 <Property Name="Amount" Precision="2" Scale="2" /> not allowed, because .23 is not allowed anymore and 0.23 needs precision 3 <Property Name="Amount" Precision="3" Scale="variable" /> allowed Values: 1.23, 0.23, 0.7, 123, 12.3 not allowed values: 12.34, 1234, 123.4 Accepted: https://www.oasis-open.org/committees/download.php/52637/odata-meeting-69_on-20140327-minutes.html#odata-566

      Description

      The current text says

      A decimal property MAY define a non-negative integer value or variable for the Scale attribute.
      This attribute specifies the maximum number of digits allowed to the right of the decimal point.
      The value variable means that the number of digits to the right of the decimal point may vary from zero to the value of the Precision attribute.
      The value of the Scale attribute MUST be less than or equal to the value of the Precision attribute.

      Unfortunately this conflicts with the ABNF rule decimalValue that makes the fractional part optional but requires at least one digit in the integer part, so if Precision limits the number of digits to e.g. 10, at most 9 digits can be to the right of the decimal point.

      Also the text does not make clear that a numeric Scale value implies a fixed-point number with Scale fractional digits and Precision-Scale integer digits, and that the only variability is to remove leading zeroes from the integer part and trailing zeroes from the fractional part.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: