Difference between revisions of "Number formats"

(→‎Number format dialog: image for 6.3)
 
(29 intermediate revisions by 4 users not shown)
Line 1: Line 1:
[[Category:Analytica User Guide]]
+
[[Category: Analytica User Guide]]  
<languages />
+
[[Category: Windows and dialogs]]
<translate>
+
[[Category:Number formats]]
[[Analytica User Guide]] >
+
<breadcrumbs>Analytica User Guide > Number and table formats > {{PAGENAME}}</breadcrumbs>
__NOTOC__
+
{{ReleaseBar}}
The '''Number format '''dialog lets you control the format of numbers and dates displayed in tables, graphs, and input or output fields. You can select options like the number of decimal digits, currency signs, and commas to separate thousands. The default number format is ''suffix'', which uses a letter following the number, such 10K to mean 10,000 (where ''K ''means Kilo or thousands).
 
  
The number format of a variable is used wherever the value of that variable appears —in a result table, graph, input field, or output field. The number format of an index applies wherever that index is used, including row or column headers of a table, or along an axis of a graph that uses that index.
+
Number format controls options such the number of decimal digits, the currency sign, commas to separate thousands, and display of negative numbers.  It also controls the format of dates. You can set a format for numbers and dates displayed in  an [[Table|edit table]], [[Table view of a result|result table]], [[Graph view of a result|graph]], or field of a [[User input nodes and user output nodes|user input, or output]]. The number format of an [[Arrays and Indexes|index]] applies wherever that index is used, including row or column headers of a table, or graph axis that uses that index. With Analytica 5.0, you can set a number format for each cell, row, column, or other slice of an array.  
  
You can enter a number into an expression or table in any format, no matter what output format it uses.
+
You can enter a number into an [[expression]] or table in any format, no matter what output format it uses.
 +
 
 +
=== Number format dialog ===
  
 
To set the number format for a variable:
 
To set the number format for a variable:
 
+
# Select the variable to format by showing its edit table, result table, or graph, or by selecting its node in a diagram. You can apply the same format to multiple variables at once if you select their nodes together in a diagram.
# Select a variable by showing its edit table, result table, or graph, or by selecting its node in a diagram. To apply the same format to several variables, select their nodes together in a diagram.
+
# Select '''Number format '''from the [[Result menu]], or press ''Control+b'', to show this dialog:<br>
# Select '''Number format '''from the '''Result '''menu, or press ''Control+b'', to show this dialog. <br /> [[File:Chapter7_1.png]]
+
#:{{Release||6.2|[[Image:NumberFormatDialog.png]]}}{{Release|6.3||[[Image:NumberFormatDialog6.3.png]]}}
# Select the format type you want from the list on the left.
+
<ol start="3">
# Select options you want, such as ''Decimal digits'', ''Show trailing zeroes'', ''Thousands separators'', or ''Show currency symbol'', from checkboxes, menus, and fields on the right. The options available depend on which format you selected.
+
<li> Select the format type you want from the list on the left.
# View the example at the top of the dialog to see if the format is what you want.
+
<li> Select options you want, such as '''''Decimal digits''''', '''''Show trailing zeroes''''', '''''Thousands separators''''', or '''''Show currency symbol''''', from the menus and checkboxes. The options available depend on which format you selected.
# If so, click the '''Apply '''button.
+
<li> View the example at the top of the dialog to see if the format is what you want.
 +
<li> If so, click the '''Apply '''button.
 +
</ol>
  
 
You can change the default number format by pressing '''Set Default'''. The default format applies to all variables in your model whose number format has not been explicitly set.
 
You can change the default number format by pressing '''Set Default'''. The default format applies to all variables in your model whose number format has not been explicitly set.
  
'''Format types''': Choose one of these number formats:
+
{{Release|5.0||<Tip title="Tip">When you bring up the [[Number Format Dialog]] while viewing a table, pay particular attention to which cells are selected. When you want the format to apply to the entire table, first deselect all cells by clicking in the table header area, or select all cells first. If you have selected a single cell, you may end up changing the number format for a single cell. If a subset of cells are selected, your format will apply to those cells only.</Tip>}}
  
[[File:Chapter7_2.png]]
+
=== Types of number format ===
  
'''Suffix characters''': Suffix is Analytica’s default format. It uses a conventional letter after each number to specify powers of 10: 12K means 12,000 (''K ''for kilo or thousands), 2.5M means 2,500,000 (''M ''for Mega or mil- lions), 5n means 0.000,000,005 (''n ''means nano or billionths). Here are the suffix characters:
+
The default number format is '''''suffix''''', which uses a letter after the number to denote order of magnitude -- for example, 10K means 10,000, where ''K ''means Kilo or thousands.  Choose one of these number formats:
 +
:{| class="wikitable"
 +
!Format
 +
!Description
 +
!Example
 +
|-
 +
! Suffix
 +
|A letter after the number specifies power of ten
 +
|12.35K
 +
|-
 +
! Exponential
 +
|Scientific notation, where the number after 'e' gives
 +
the powers of ten
 +
|1.2345e04
 +
|-
 +
! General
 +
| (new to [[Analytica 5.0]]) Floating point number with a specified number of significant digits. Reverts to scientific notation only when a number is extreme, or the non-scientific notation depiction would contain more than the specified number of significant digits.
 +
| 12345.678
 +
|-
 +
! Fixed Point
 +
|Number with a fixed number of digits after the decimal point
 +
|12345.68
 +
|-
 +
! Integer
 +
|A whole number with no decimals shown
 +
|12346
 +
|-
 +
! Date
 +
|Show number (days since 1 Jan 1900) as a date and/or time
 +
(see below for format options)
 +
|12 Jan 2007
 +
|-
 +
! Boolean
 +
|Display 0 as '''<code>False</code>''', and any other number as '''<code>True</code>'''
 +
|True, False
 +
|-  
 +
! Hexadecimal
 +
| (new to [[Analytica 5.0]]) Display an integer in base-16 using the digits 0-9 and a-f. The number is prefixed with <code>0x</code>. When a negative number is displayed, its two's complement is shown.
 +
| 0x303a
 +
|-
 +
! Binary
 +
| (new to [[Analytica 5.0]]) Display an integer in base-2 using the digits 0 and 1. The number is prefixed with <code>0xb</code>. When the number is negative, its 64-bit two's complement is shown.
 +
| 0b11000000111010
 +
|}
  
[[File:Chapter7_3.png]]
+
==== Suffix number format ====
 +
Suffix is Analytica’s default number format. It uses a conventional letter after each number to specify powers of 10: 12K means 12,000 ('''''K''' ''for kilo or thousands), 2.5M means 2,500,000 ('''''M''' ''for Mega or millions), 5n means 0.000,000,005 ('''''n''' ''means nano or billionths). Here are the suffix characters:
 +
:{| class="wikitable"
 +
!Power of 10
 +
!Suffix
 +
!Prefix
 +
| rowspan="7" |
 +
!Power of 10
 +
!Suffix
 +
!Prefix
 +
|-
 +
|
 +
|
 +
|
 +
!10<sup>-2</sup>
 +
|%
 +
|percent
 +
|-
 +
!10<sup>3</sup>
 +
|K
 +
|Kilo
 +
!10<sup>-3</sup>
 +
|m
 +
|milli
 +
|-
 +
!10<sup>6</sup>
 +
|M
 +
|Mega or Million
 +
!10<sup>-6</sup>
 +
|μ or u
 +
|micro (mu)
 +
|-
 +
!10<sup>9</sup>
 +
|G or B
 +
|Giga or Billion
 +
!10<sup>-9</sup>
 +
|n
 +
|nano
 +
|-
 +
!10<sup>12</sup>
 +
|T
 +
|Tera or Trillion
 +
!10<sup>-12</sup>
 +
|p
 +
|pico
 +
|-
 +
!10<sup>15</sup>
 +
|Q
 +
|Quadrillion
 +
!10<sup>-15</sup>
 +
|f
 +
|femto
 +
|}
  
 
<tip title="Tip">Note the difference between “M” for Mega or Million and “m” for milli (1/1000). This is the only situation in which Analytica cares about the difference between uppercase and lowercase. Otherwise, it is insensitive to case (except when matching text values).</tip>
 
<tip title="Tip">Note the difference between “M” for Mega or Million and “m” for milli (1/1000). This is the only situation in which Analytica cares about the difference between uppercase and lowercase. Otherwise, it is insensitive to case (except when matching text values).</tip>
  
<tip title="Tip">In suffix format, it displays four-digit numbers without the “K” suffix — e.g., 2010, not 2.010K — which works better for years. For suffix, integer, or fixed point formats, it uses exponent format for numbers too large or small — e.g., numbers larger than 109 in integer or fixed point format, or larger than 1018 in suffix format.</tip>
+
<tip title="Tip">In suffix format, it displays four-digit numbers without the “K” suffix — e.g., 2010, not 2.010K — which works better for years. For suffix, integer, or fixed point formats, it uses exponent format for numbers too large or small — e.g., numbers larger than 10<sup>9</sup> in integer or fixed point format, or larger than 10<sup>18</sup> in suffix format.</tip>
  
'''Maximum precision''': The maximum number of digits including decimal digits is 15 (14 for fixed point and percent); the maximum precision is 15 digits (9 for integers).
+
'''Maximum precision''': The maximum number of digits including decimal digits is 15 (14 for fixed point and percent). The maximum precision is 15 digits (9 for integers).
  
 
==Number format options ==
 
==Number format options ==
Line 41: Line 139:
  
 
'''Thousands separators''': Check to show commas between every third digit of the integer part, e.g., 12,345.678, instead of 12345.678.
 
'''Thousands separators''': Check to show commas between every third digit of the integer part, e.g., 12,345.678, instead of 12345.678.
 +
 +
'''Display dates as numbers''': Displays a date or time data type as a number, where the value is the number of days after the [[Date_Functions#Date_values_and_the_date_origin|date origin]].
 +
 +
'''Display numbers as dates''': Interprets a numeric value as a date, equal to the number of days past the [[Date_Functions#Date_values_and_the_date_origin|date origin]].
 +
 +
{{Release|6.3||'''Show complex number im part when it is zero''': When on, forces the [[ImPart|imaginary part]] of a complex number to show even when the value is zero. For example, it might display <code>5+0j</code> instead of just 5, or <code>0j</code> instead of just 0.}}
  
 
'''Show currency symbol''': Check to show a currency symbol. Select the symbol and placement from these menus.
 
'''Show currency symbol''': Check to show a currency symbol. Select the symbol and placement from these menus.
Line 51: Line 155:
  
 
==See Also==
 
==See Also==
{| style="margin: 1em auto 1em auto;width: 100%;border:0;table-layout: fixed;" cellpadding=5
+
<div style="column-count:2;-moz-column-count:2;-webkit-column-count:2">
|- style="text-align: center"
+
* [[Number Format Dialog]]
| [[Chapter 7: Formatting Numbers, Tables, and Graphs]] <- || [[Number formats]] || -> [[Date formats]]
+
* [[NumberFormat]] attribute
|}
+
* [[Numbers]]
</translate>
+
* [[Data_Type_Functions#Function_IsNumber|IsNumber]]
 +
* [[NaN|Not a Number]]
 +
* [[Complex Numbers]]
 +
* [[Binary and hexadecimal integer formats]]
 +
* [[ReadBinaryFile]]
 +
* [[WriteBinaryFile]]
 +
* [[BitAnd]]
 +
* [[NumberToText]]
 +
* [[Numbers and text]]
 +
* [[ParseNumber]]
 +
* [[Result menu]]
 +
* [https://lumina.com/community/models-and-application-examples/displaying-b-for-billion-%c2%b5-for-micro/ Displaying B for billion, µ for micro]] ([https://lumina.com/community Forum posting])
 +
</div>
 +
 
 +
 
 +
<footer>Number and table formats / {{PAGENAME}} / Date formats</footer>

Latest revision as of 22:41, 27 December 2022



Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5


Number format controls options such the number of decimal digits, the currency sign, commas to separate thousands, and display of negative numbers. It also controls the format of dates. You can set a format for numbers and dates displayed in an edit table, result table, graph, or field of a user input, or output. The number format of an index applies wherever that index is used, including row or column headers of a table, or graph axis that uses that index. With Analytica 5.0, you can set a number format for each cell, row, column, or other slice of an array.

You can enter a number into an expression or table in any format, no matter what output format it uses.

Number format dialog

To set the number format for a variable:

  1. Select the variable to format by showing its edit table, result table, or graph, or by selecting its node in a diagram. You can apply the same format to multiple variables at once if you select their nodes together in a diagram.
  2. Select Number format from the Result menu, or press Control+b, to show this dialog:
    NumberFormatDialog6.3.png
  1. Select the format type you want from the list on the left.
  2. Select options you want, such as Decimal digits, Show trailing zeroes, Thousands separators, or Show currency symbol, from the menus and checkboxes. The options available depend on which format you selected.
  3. View the example at the top of the dialog to see if the format is what you want.
  4. If so, click the Apply button.

You can change the default number format by pressing Set Default. The default format applies to all variables in your model whose number format has not been explicitly set.

Tip
When you bring up the Number Format Dialog while viewing a table, pay particular attention to which cells are selected. When you want the format to apply to the entire table, first deselect all cells by clicking in the table header area, or select all cells first. If you have selected a single cell, you may end up changing the number format for a single cell. If a subset of cells are selected, your format will apply to those cells only.

Types of number format

The default number format is suffix, which uses a letter after the number to denote order of magnitude -- for example, 10K means 10,000, where K means Kilo or thousands. Choose one of these number formats:

Format Description Example
Suffix A letter after the number specifies power of ten 12.35K
Exponential Scientific notation, where the number after 'e' gives

the powers of ten

1.2345e04
General (new to Analytica 5.0) Floating point number with a specified number of significant digits. Reverts to scientific notation only when a number is extreme, or the non-scientific notation depiction would contain more than the specified number of significant digits. 12345.678
Fixed Point Number with a fixed number of digits after the decimal point 12345.68
Integer A whole number with no decimals shown 12346
Date Show number (days since 1 Jan 1900) as a date and/or time

(see below for format options)

12 Jan 2007
Boolean Display 0 as False, and any other number as True True, False
Hexadecimal (new to Analytica 5.0) Display an integer in base-16 using the digits 0-9 and a-f. The number is prefixed with 0x. When a negative number is displayed, its two's complement is shown. 0x303a
Binary (new to Analytica 5.0) Display an integer in base-2 using the digits 0 and 1. The number is prefixed with 0xb. When the number is negative, its 64-bit two's complement is shown. 0b11000000111010

Suffix number format

Suffix is Analytica’s default number format. It uses a conventional letter after each number to specify powers of 10: 12K means 12,000 (K for kilo or thousands), 2.5M means 2,500,000 (M for Mega or millions), 5n means 0.000,000,005 (n means nano or billionths). Here are the suffix characters:

Power of 10 Suffix Prefix Power of 10 Suffix Prefix
10-2 % percent
103 K Kilo 10-3 m milli
106 M Mega or Million 10-6 μ or u micro (mu)
109 G or B Giga or Billion 10-9 n nano
1012 T Tera or Trillion 10-12 p pico
1015 Q Quadrillion 10-15 f femto
Tip
Note the difference between “M” for Mega or Million and “m” for milli (1/1000). This is the only situation in which Analytica cares about the difference between uppercase and lowercase. Otherwise, it is insensitive to case (except when matching text values).
Tip
In suffix format, it displays four-digit numbers without the “K” suffix — e.g., 2010, not 2.010K — which works better for years. For suffix, integer, or fixed point formats, it uses exponent format for numbers too large or small — e.g., numbers larger than 109 in integer or fixed point format, or larger than 1018 in suffix format.

Maximum precision: The maximum number of digits including decimal digits is 15 (14 for fixed point and percent). The maximum precision is 15 digits (9 for integers).

Number format options

Decimal digits: The number of digits to show after the decimal point.

Show trailing zeroes: Check to show trailing zeroes in decimals, e.g., 2.100 instead of 2.1, when decimal digits are set to 3.

Thousands separators: Check to show commas between every third digit of the integer part, e.g., 12,345.678, instead of 12345.678.

Display dates as numbers: Displays a date or time data type as a number, where the value is the number of days after the date origin.

Display numbers as dates: Interprets a numeric value as a date, equal to the number of days past the date origin.

Show complex number im part when it is zero: When on, forces the imaginary part of a complex number to show even when the value is zero. For example, it might display 5+0j instead of just 5, or 0j instead of just 0.

Show currency symbol: Check to show a currency symbol. Select the symbol and placement from these menus.

Chapter7 4.png

Placement controls the relative location of the currency symbol, e.g., $200 or 200DM, and whether to use a minus sign -$200 or parentheses ($200) to indicate a negative number.

Regional settings: If you select the last entry, regional, from the Symbol or Placement menu, it uses, respectively, the regional currency or placement settings set for your computer. You can modify these settings in the Regional and Language options available from the Windows Control Panel.

See Also


Comments


You are not allowed to post comments.