Uploaded image for project: 'OASIS Open Document Format for Office Applications (OpenDocument) TC'
  1. OASIS Open Document Format for Office Applications (OpenDocument) TC
  2. OFFICE-3860

Extend specification of number of decimal digits in number formatting

    XMLWordPrintable

    Details

    • Resolution:
      Hide

      I. Schema changes:

      diff -u OpenDocument-v1.2-os-schema.rng 3860-schema.rng 
      --- OpenDocument-v1.2-os-schema.rng	2015-05-11 15:10:17.769956374 +0200
      +++ 3860-schema.rng	2015-05-11 15:16:40.307446101 +0200
      @@ -12678,12 +12678,17 @@
       	<define name="number-scientific-number-attlist">
       		<optional>
       			<attribute name="number:min-exponent-digits">
       				<ref name="integer"/>
       			</attribute>
       		</optional>
      +		<optional>
      +			<attribute name="number:forced-exponent-sign">
      +				<ref name="boolean"/>
      +			</attribute>
      +		</optional>
       	</define>
       	<define name="number-fraction">
       		<element name="number:fraction">
       			<ref name="number-fraction-attlist"/>
       			<ref name="common-number-attlist"/>
       			<empty/>
      @@ -13191,12 +13196,17 @@
       	<define name="common-decimal-places-attlist">
       		<optional>
       			<attribute name="number:decimal-places">
       				<ref name="integer"/>
       			</attribute>
       		</optional>
      +		<optional>
      +			<attribute name="number:min-decimal-places">
      +				<ref name="integer"/>
      +			</attribute>
      +		</optional>
       	</define>
       	<define name="common-number-attlist">
       		<interleave>
       			<optional>
       				<attribute name="number:min-integer-digits">
       					<ref name="integer"/>
      
      

      II.
      Section 16.27.3 <number:number>

      Add to the generated "The <number:number> element has the following attributes:"

      number:min-decimal-places 19.xxy

      III.
      Section 16.27.5 <number:scientific-number>

      Add to the generated "The <number:scientific-number> element has the following attributes":

      number:min-decimal-places 19.xxy and number:forced-exponent-sign 19.xxz

      IV. Add new section:
      Section 19.xxy number:min-decimal-places

      Section 19.xxy.1 General
      The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part.

      The value of the number:min-decimal-places attribute shall not be greater than the value of the number:decimal-places attribute.

      If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed.

      Section 19.xxy.2 <number:number>
      If the number:min-decimal-places attribute is not specified, it is set to:

      • 0 if the value of the number:decimal-replacement attribute is the empty string
      • the value of the number:decimal-places attribute in other cases.

      If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed.

      The number:min-decimal-places attribute is usable with the following element: <number:number> 16.27.3.
      The number:min-decimal-places attribute has the data type integer 18.2.

      Section 19.xxy.3 <number:scientific-number>
      If the number:min-decimal-places attribute is not specified, it is set to the value of the number:decimal-places attribute.

      The number:min-decimal-places attribute is usable with the following element: <number:scientific-number> 16.27.5.
      The number:min-decimal-places attribute has the data type integer 18.2.

      V. Add new section:
      Section 19.xxz number:forced-exponent-sign

      The number:forced-exponent-sign attribute specifies whether the sign of the exponent for a scientific number is always displayed.
      The defined values for the number:forced-exponent-sign attribute are:

      • false: the exponent sign is displayed only for a negative value of the exponent, otherwise it is not displayed.
      • true: the exponent sign is always displayed regardless of the value of exponent.

      The default value for this attribute is true.

      The number:forced-exponent-sign attribute is usable with the following element: <number:scientific-number> 16.27.5.
      The number:forced-exponent-sign attribute has the data type boolean 18.3.3.

      Show
      I. Schema changes: diff -u OpenDocument-v1.2-os-schema.rng 3860-schema.rng --- OpenDocument-v1.2-os-schema.rng 2015-05-11 15:10:17.769956374 +0200 +++ 3860-schema.rng 2015-05-11 15:16:40.307446101 +0200 @@ -12678,12 +12678,17 @@ <define name="number-scientific-number-attlist"> <optional> <attribute name="number:min-exponent-digits"> <ref name="integer"/> </attribute> </optional> + <optional> + <attribute name="number:forced-exponent-sign"> + <ref name="boolean"/> + </attribute> + </optional> </define> <define name="number-fraction"> <element name="number:fraction"> <ref name="number-fraction-attlist"/> <ref name="common-number-attlist"/> <empty/> @@ -13191,12 +13196,17 @@ <define name="common-decimal-places-attlist"> <optional> <attribute name="number:decimal-places"> <ref name="integer"/> </attribute> </optional> + <optional> + <attribute name="number:min-decimal-places"> + <ref name="integer"/> + </attribute> + </optional> </define> <define name="common-number-attlist"> <interleave> <optional> <attribute name="number:min-integer-digits"> <ref name="integer"/> II. Section 16.27.3 <number:number> Add to the generated "The <number:number> element has the following attributes:" number:min-decimal-places 19.xxy III. Section 16.27.5 <number:scientific-number> Add to the generated "The <number:scientific-number> element has the following attributes": number:min-decimal-places 19.xxy and number:forced-exponent-sign 19.xxz IV. Add new section: Section 19.xxy number:min-decimal-places Section 19.xxy.1 General The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part. The value of the number:min-decimal-places attribute shall not be greater than the value of the number:decimal-places attribute. If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed. Section 19.xxy.2 <number:number> If the number:min-decimal-places attribute is not specified, it is set to: 0 if the value of the number:decimal-replacement attribute is the empty string the value of the number:decimal-places attribute in other cases. If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed. The number:min-decimal-places attribute is usable with the following element: <number:number> 16.27.3. The number:min-decimal-places attribute has the data type integer 18.2. Section 19.xxy.3 <number:scientific-number> If the number:min-decimal-places attribute is not specified, it is set to the value of the number:decimal-places attribute. The number:min-decimal-places attribute is usable with the following element: <number:scientific-number> 16.27.5. The number:min-decimal-places attribute has the data type integer 18.2. V. Add new section: Section 19.xxz number:forced-exponent-sign The number:forced-exponent-sign attribute specifies whether the sign of the exponent for a scientific number is always displayed. The defined values for the number:forced-exponent-sign attribute are: false: the exponent sign is displayed only for a negative value of the exponent, otherwise it is not displayed. true: the exponent sign is always displayed regardless of the value of exponent. The default value for this attribute is true. The number:forced-exponent-sign attribute is usable with the following element: <number:scientific-number> 16.27.5. The number:forced-exponent-sign attribute has the data type boolean 18.3.3.

      Description

      This relates to the comment received in https://lists.oasis-open.org/archives/office-comment/201407/msg00008.html

      Currently the number:number element use a single attribute number:decimal-places to specify the number of decimal digits to be used. This means that formats such as "0.00#" (specified here using the Excel number format syntax) cannot be translated into ODF without the use of conditional formatting.

      I would propose to add an attribute to allow for formats of this type.

        Attachments

          Activity

            People

            • Assignee:
              aguelzow Andreas Guelzow (Inactive)
              Reporter:
              aguelzow Andreas Guelzow (Inactive)
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: