Difference between revisions of "Multiple formats in one table"

Line 3: Line 3:
  
  
Usually, the same number format applies to all numbers in a table (except its index values in column or row headers, which use the format set for the index variable). Sometimes, you might want to use different formats for different rows (more generally, ''slices'') of a table. You can do this if you define the table as a list of variables, for example:
+
Usually, the same [[Number formats|number format]] applies to all numbers in a table (except its index values in column or row headers, which use the format set for the index variable). Sometimes, you might want to use different formats for different rows (more generally, [[slice]]s) of a table. You can do this if you define the table as a list of variables, for example:
 +
 
 
:<code>Index Years := 2007..2012</code>
 
:<code>Index Years := 2007..2012</code>
 
:<code>Variable DollarX := Table(Years)(...) { Formatted as dollars }</code>
 
:<code>Variable DollarX := Table(Years)(...) { Formatted as dollars }</code>
Line 15: Line 16:
  
 
==See Also==
 
==See Also==
 +
* [[Number formats]]
 
* [[Creating Arrays (Tables)]]
 
* [[Creating Arrays (Tables)]]
 
* [[Working with Arrays (Tables)]]
 
* [[Working with Arrays (Tables)]]
 
* [[Table]]
 
* [[Table]]
 +
* [[Slice]]
  
  
 
<footer>Display of constraint results / {{PAGENAME}} / Graphing roles</footer>
 
<footer>Display of constraint results / {{PAGENAME}} / Graphing roles</footer>

Revision as of 21:47, 4 April 2016


Usually, the same number format applies to all numbers in a table (except its index values in column or row headers, which use the format set for the index variable). Sometimes, you might want to use different formats for different rows (more generally, slices) of a table. You can do this if you define the table as a list of variables, for example:

Index Years := 2007..2012
Variable DollarX := Table(Years)(...) { Formatted as dollars }
Variable PercentX := DollarX/40K { Formatted as percent }
Variable MultiformatX := [DollarX, PercentX]
MultiformatX →
Chapter7 8.png

This table uses the number format set for each variable responsible for a row here — as long as you don’t override their settings by setting a format for MultiformatX.

See Also


Comments


You are not allowed to post comments.