Difference between revisions of "Calc/Features/Automatic decimal place adjustment"

From Apache OpenOffice Wiki
< Calc‎ | Features
Jump to: navigation, search
(Options dialog)
(Handling of small numbers)
 
(26 intermediate revisions by the same user not shown)
Line 46: Line 46:
 
|-
 
|-
 
| '''Quality Assurance'''
 
| '''Quality Assurance'''
| ''undetermined''
+
| Oliver Craemer
|  
+
| Oliver.Craemer@Sun.COM
 
|-
 
|-
 
| '''Documentation'''
 
| '''Documentation'''
Line 62: Line 62:
  
 
=== Options dialog ===
 
=== Options dialog ===
[[Image:Calc_Automatic_decimal_options.png|thumb|right|New check box to control automatic decimal adjustment behavior.]]
+
In the '''Options''' dialog, the '''Calculate''' page will have a new check box labeled '''Limit decimals for general number format'''.  When this check box is checked, you can specify the maximum number of decimal places allowed for cells with General number format.  A value of 0 to 20 is allowed as the maximum number of decimal places.
In the '''Options''' dialog, the '''Calculate''' page will have a new check box labeled '''Limit decimals for general number format'''.  When this check box is checked, you can specify the maximum number of decimal places allowed for cells with General number format.  When this check box is ''not'' checked, cells with General number format will use as many decimal places as the column width allows.  By default, this option is ''not'' checked.
+
  
=== Adjusting decimal places by column with ===
+
When this check box is ''not'' checked, cells with General number format will use as many decimal places as the column width allowsBy default, this option is ''not'' checked.
When the number format for a cell is ''General'' and its displayed content is numeric, it is subject to automatic decimal place adjustment based on available column width.  The adjustment is performed in the following fashion.
+
  
First, Calc tries to fit the displayed number within the cell width by reducing the number of decimal places.  If the number doesn't fit even after all the decimal places have been exhausted, it then switches to scientific notation and continue adjusting decimal places in that notation.  If the number still doesn't fit even with the scientific notation, it displays '###' in place of the original value.
+
[[Image:Calc_Automatic_decimal_options.png|thumb|400px|center|New check box to control automatic decimal adjustment behavior.]]
 +
 
 +
=== Adjusting decimal places by column width ===
 +
[[Image:Calc_Automatic_decimal_adjustment.png|thumb|220px|right|(1) Optimal column width, with maximum number of significant digits shown, (2) adjusting by truncating decimals, (3) switching to scientific notation, (4) truncating decimals in the scientific notation, and (5) all adjustment options exhausted, displaying '###' as a last resort.]]
 +
 
 +
When the number format for a cell is ''General'' and its displayed value is numeric, it undergoes automatic decimal place adjustment to fit available column width if the column is not wide enough to display the cell value in full.  This adjustment is performed in the following fashion.
 +
 
 +
First, Calc tries to fit the displayed number within the width of the cell by reducing the number of decimal places.  If the number doesn't fit even after all the decimal places have been exhausted, it then switches to scientific notation and continue adjusting decimal places in that notation.  If the number still doesn't fit even with the scientific notation, it displays '###' in place of the original value.
 +
 
 +
==== Handling of small numbers ====
 +
There is an exception to this rule specified above.  When the value of the cell is less than 0.0001 (=1.0E-04), the value is displayed in scientific notation if
 +
 
 +
* in case the column is wide enough not to trigger automatic adjustment, the total number of characters that would be displayed in decimal notation exceeds 11 (or 12 for negative numbers accounting for the minus sign), or
 +
* the value is undergoing automatic adjustment to fit within the column width.
  
 
== Migration ==
 
== Migration ==
Line 74: Line 85:
  
 
== Configuration ==
 
== Configuration ==
N/A
+
 
 +
The node '''Calc/Calculate/Other/DecimalPlaces''' stores The option for the automatic adjustment of decimal places for the General number format.  When the '''Limit decimals for general number format''' option is not set, the value of -1 is stored in this node.  When this option is set, the specified decimal places (which is a positive value) is stored in this node instead.
  
 
== File Format ==
 
== File Format ==

Latest revision as of 14:57, 4 February 2010

Automatic decimal place adjustment

Specification Status
Author Kohei Yoshida
Last Change See wiki history
Status In progress in CWS koheiautodecimal

Abstract

Cells containing either numeric value or formula whose result is numeric are subject to automatic adjustment of decimal places based on the available column width. The automatic decimal place adjustment takes place only when their number format is General.

References

Reference Document Check Location (URL)
Issue ID (required) available Issue 26826 Issue 46511
Test case specification (required) n/a

Contacts

Role Name E-Mail Address
Developer Kohei Yoshida kyoshida@novell.com
Quality Assurance Oliver Craemer Oliver.Craemer@Sun.COM
Documentation up for grabs!
User Experience up for grabs!

Detailed Specification

Options dialog

In the Options dialog, the Calculate page will have a new check box labeled Limit decimals for general number format. When this check box is checked, you can specify the maximum number of decimal places allowed for cells with General number format. A value of 0 to 20 is allowed as the maximum number of decimal places.

When this check box is not checked, cells with General number format will use as many decimal places as the column width allows. By default, this option is not checked.

New check box to control automatic decimal adjustment behavior.

Adjusting decimal places by column width

(1) Optimal column width, with maximum number of significant digits shown, (2) adjusting by truncating decimals, (3) switching to scientific notation, (4) truncating decimals in the scientific notation, and (5) all adjustment options exhausted, displaying '###' as a last resort.

When the number format for a cell is General and its displayed value is numeric, it undergoes automatic decimal place adjustment to fit available column width if the column is not wide enough to display the cell value in full. This adjustment is performed in the following fashion.

First, Calc tries to fit the displayed number within the width of the cell by reducing the number of decimal places. If the number doesn't fit even after all the decimal places have been exhausted, it then switches to scientific notation and continue adjusting decimal places in that notation. If the number still doesn't fit even with the scientific notation, it displays '###' in place of the original value.

Handling of small numbers

There is an exception to this rule specified above. When the value of the cell is less than 0.0001 (=1.0E-04), the value is displayed in scientific notation if

  • in case the column is wide enough not to trigger automatic adjustment, the total number of characters that would be displayed in decimal notation exceeds 11 (or 12 for negative numbers accounting for the minus sign), or
  • the value is undergoing automatic adjustment to fit within the column width.

Migration

N/A

Configuration

The node Calc/Calculate/Other/DecimalPlaces stores The option for the automatic adjustment of decimal places for the General number format. When the Limit decimals for general number format option is not set, the value of -1 is stored in this node. When this option is set, the specified decimal places (which is a positive value) is stored in this node instead.

File Format

N/A

Open Issues

Not yet determined.

Personal tools