manual:chapter3:numformatting

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
manual:chapter3:numformatting [2017/08/13 11:51]
claudio [Displaying and Formatting Numbers]
manual:chapter3:numformatting [2017/08/13 12:17]
claudio [The Format String]
Line 40: Line 40:
 ''"#.4#0"'': Same as above, after the number of digits, a zero indicates that trailing zeros need to be added. When the number of digits is explicitly given the presence of the zero does not add another digit, in this example a total of 4 will be displayed. ''"#.4#0"'': Same as above, after the number of digits, a zero indicates that trailing zeros need to be added. When the number of digits is explicitly given the presence of the zero does not add another digit, in this example a total of 4 will be displayed.
  
-''"#.###0S4"'': The ''S'' after the number of digits indicates the fractional digit separator needs to be included, in this case with an optional spacing of digits. When no number of digits is included, the default is 3 digits (NOTE: the number of digits in a group must match between the integer and fractional part of the number, it's an invalid format string to request separators every 'n' digits on the integer part, and 'm' digits on the fractional part when m≠n).+''"#.A#"'': The ''A'' here is replacing the number of decimal figures and means all digits, and will output as many digits as the number has stored. This is useful to store numbers as text or to edit a number, since it allows to recover the same number from the generated text. 
 + 
 +''"#.###0S2"'': The ''S'' after the number of digits indicates the fractional digit separator needs to be included, in this case with an optional spacing of digits. When number of digits is not included, the default is 3 digits (NOTE: the number of digits in a group must match between the integer and fractional part of the number, it's an invalid format string to request separators every 'n' digits on the integer part, and 'm' digits on the fractional part when m≠n). Valid values for S are 1 through 15, and the separator character used will be as defined by the command ''SETLOCALE''.
  
 ''"#.###0."'': The trailing dot will display the dot on approximate numbers. ''"#.###0."'': The trailing dot will display the dot on approximate numbers.
  
-A number will be displayed in scientific notation when the exponent letter ''e'' or ''E'' is included in the format string after the fractional part.+''"#.#0E"'': A number will be displayed in scientific notation when the exponent letter ''e'' or ''E'' is included in the format string after the fractional part. In this example, 2 decimal figures will be shown (adding trailing zeros as needed) in scientific notation, using a capital ''E'' to separate the exponent from the mantissa. 
 + 
 +''"#.#0E*"'': An asterisk following the exponent letter will suppress the exponent in scientific mode when the exponent is zero. For example the number ''1.5'' will display as ''1.50E0'' unless the asterisk is present in the format string to suppress it. and show only ''1.50''
 + 
 +''"#.#0E*+"'': A plus sign after the exponent letter will force the exponent sign for positive exponents (negative exponents are always displayed with the sign). 
 + 
 +''"#.#0E*+3"'': When a number is present after the exponent letter, it activates engineering mode, and indicates a preferred exponent. All numbers will display using the requested exponent (engineering mode with a fixed exponent). The preferred exponent can be in the range -21 to +21, and has to be a multiple of 3. When using engineering mode with a preferred exponent, the asterisk will always suppress the exponent (not only when it's zero). 
 + 
 +''"#.#0E*+#"'': When the preferred exponent is expressed as a numeral sign, it activates engineering mode without a preferred exponent. The displayed number will have an exponent multiple of 3, chosen by the system to ensure the integer part of the mantissa is between 1 and 999. 
  
  • manual/chapter3/numformatting.txt
  • Last modified: 2021/10/05 15:29
  • by jojo1973