Difference between revisions of "NumberFormat"
(Expanded items >11 descriptions) |
(→Format) |
||
Line 66: | Line 66: | ||
::: 'text' : literal text, e.g., 'Q'q could produce Q2 | ::: 'text' : literal text, e.g., 'Q'q could produce Q2 | ||
;<code>«fullPrecision»</code> (item 12): (optional), <code>0</code> or <code>1</code> (default <code>0</code>) : whether full precision is required always | ;<code>«fullPrecision»</code> (item 12): (optional), <code>0</code> or <code>1</code> (default <code>0</code>) : whether full precision is required always | ||
− | ;<code>«fullDateTemplate»</code> (item 13): (optional) | + | ;<code>«fullDateTemplate»</code> (item 13): (optional) The date template used instead of «dateTemplate» when running in a release «relReqForFullDateTemplate» or later. This is used for backward compatibility legacy support. |
− | ;<code>«relReqForFullDateTemplate»</code> (item 14): (optional) | + | ;<code>«relReqForFullDateTemplate»</code> (item 14): (optional) A release number as a number major*10K+minor*100+patch, e.g., 50104 for release 5.1.4. The minimum release at which «fullDateTemplate» is preferred to «dateTemplate». |
− | ;<code>«datesAsNumbers»</code> (item 15): (optional) | + | ;<code>«datesAsNumbers»</code> (item 15): (optional) 0 or 1. When 1, date and date-time numbers are displayed as numbers -- as the number of days past the date origin. |
− | ;<code>«numbersAsDates»</code> (item 16): (optional) | + | ;<code>«numbersAsDates»</code> (item 16): (optional) 0 or 1. When 1, numbers are displayed as dates, and are interpreted as the number of days after the date origin. |
− | ;<code>«digitsForGeneralFmt»</code> (item 17): (optional) | + | ;<code>«digitsForGeneralFmt»</code> (item 17): (optional) This is the number of digits used when the General format is selected (in [[Analytica 5.0]]). |
== History == | == History == |
Revision as of 19:12, 26 April 2018
NumberFormat attribute
This attribute records the Number Format settings for a variable.
In Analytica, only one number format is associated with any one object. To use multiple different number formats in a single table, you must have multiple objects (variables) storing each of the number formats. If you have a self-index consisting of identifiers (or define your result as a list of identifiers), the number format for each column will be taken from the variable who identifier heads that self-index column.
Format
The NumberFormat attribute has the following format:
- 2, formatcode, proxy, zeroes, separators, currency, digits, trailingZeros, currencysymbol, currencyPlacement, datetemplate, fullPrecision, fullDateTemplate, relReqForFullDateTemplate, datesAsNumbers, numbersAsDates, digitsForGeneralFmt
where:
First field is the version number of the number format
«formatcode»
(item 2)- is one of:
D
: SuffixE
: ExponentialF
: Fixed pointI
: Integer%
: PercentDD
: DateDB
: Boolean
«proxy» (item 3)
- When format code is a date, this is set to
0
,1
, or2
based on datetype. For a non-date, same as digits. This is not used directly, but is set like this to be upward compatible with Analytica 3.1 and before. «zeroes»
(item 4)- Number of digits after the decimal in fixed point and percent formats.
«separators»
(item 5)0
or1
, whether commas are used«currency»
(item 6)0
or1
, whether currency symbol is shown«digits»
(item 7)- Number of digits for exponent and suffix types.
«trailingZeros»
(item 8)- boolean.
True
= add trailing zeros to fill out precision «currencySymbol»
(item 9)- Multi-character symbol used for currency. Blank will use regional currency symbol.
«currencyPlacement»
(item 10)- One of these values:
0
= $-x1
= -$x2
= -x$3
= $x-4
= x$-5
= x-$6
= ($x)7
= (x$)8
= use regional setting
«datetemplate»
(item 11)- A string composed of these fields
y
= Two digit year with no leading zero, e.g., 5yy
= Two digit year, e.g., 05yyyy
= Four digit year, e.g., 2005M
= Numeric month (no leading zero), e.g., 4MM
= Numeric month w/leading zero, e.g., 04MMM
= Abbreviated month, e.g., AprMMMM
= Full month name, e.g., Aprild
= day of month, e.g., 9dd
= day of month w/leading zero, e.g., 09ddd
= abbreviated ordinal day of month, English only, e.g., 9thdddd
= Ordinal day of month, English only, e.g., ninthDddd
= Ordinal day of month, capitalized, e.g., Ninthwww
= Abbreviated weekday namewwww
= Weekday name, e.g., Saturdayq
= quarter, 1 through 4, e.g., 2LONG
: regional long date format, e.g., Saturday, April 9, 2005SHORT
: regional short date format, e.g., 4/09/05ABBREV
: abbreviated version of long date format, e.g., Tue, Apr 9, 2005SABBREV
: abbreviated version of long date format w/o weekday, e.g., Apr 9, 2005SLONG
: regional long date with weekday stripped, e.g., April 9, 2005- ’’’’ : A single quote, e.g., "MMM ’’’’yy" would be to produce "Apr '05"
- The doubled ' inside escapes the '.
- Literal characters: /, -, [dot], [space], [comma]
- 'text' : literal text, e.g., 'Q'q could produce Q2
«fullPrecision»
(item 12)- (optional),
0
or1
(default0
) : whether full precision is required always «fullDateTemplate»
(item 13)- (optional) The date template used instead of «dateTemplate» when running in a release «relReqForFullDateTemplate» or later. This is used for backward compatibility legacy support.
«relReqForFullDateTemplate»
(item 14)- (optional) A release number as a number major*10K+minor*100+patch, e.g., 50104 for release 5.1.4. The minimum release at which «fullDateTemplate» is preferred to «dateTemplate».
«datesAsNumbers»
(item 15)- (optional) 0 or 1. When 1, date and date-time numbers are displayed as numbers -- as the number of days past the date origin.
«numbersAsDates»
(item 16)- (optional) 0 or 1. When 1, numbers are displayed as dates, and are interpreted as the number of days after the date origin.
«digitsForGeneralFmt»
(item 17)- (optional) This is the number of digits used when the General format is selected (in Analytica 5.0).
History
In Analytica 1.0 through 3.1, the NumberFormat was:
- 1, formatcode, digits, zeroes, separators, currency
where:
First field is version number
«formatcode»
- is one of:
D
: SuffixE
: ExponentialF
: Fixed pointI
: Integer%
: PercentDD
: DateDB
: Boolean
«digits»
- Specified number of digits for exponent and suffix types, or the date type as follows:
0
= Short1
= Long2
= Abbrev
«zeroes»
- Number of digits after the decimal in fixed point and percent formats.
«separators»
0
or1
, whether commas are used«currency»
0
or1
, whether currency symbol is shown
See Also
Comments
Enable comment auto-refresher