Tables and axes > Introduction to axes > Printing characters next to absolutes
 
Printing characters next to absolutes
Quantum provides a group of keywords for printing additional characters in the cells of a table apart from the standard counts and percentages. You might find this useful for printing base figures in brackets or for printing $ or a £ signs in front of currency figures. The keywords work only with absolutes and are:
figchar=
This defines a single character to be printed beside absolutes.
figpre
This prints the figchar character before each absolute.
figpost
This prints the figchar character after each absolute.
figbracket
This is shorthand for figpre;figpost (that is, print character before and after absolutes).
You can use these keywords on the l statement to make them apply to the whole axis or on n01, col, val, fld and bit statements to apply these facilities to individual elements. If you specify figpre, figpost or figbracket on the l statement you can turn it off for an individual element by respecifying the keyword on the element, preceded by no; for example, nofigbracket on an element turns off figbracket for that element only.
The character you specify with figchar= can be a single character or a single character enclosed in dollar signs. You can choose any character you want, but certain bracketing characters will be treated in a special way. Characters that count as bracketing characters are:
(  )  {  }  [  ]  <  >
If you set figchar to one of these characters and figpre and figpost are both operative, or figbracket is operative, then that character is printed before each absolute and the matching bracket in the pair is printed after them. Here is a some code and a table which illustrate this:
tab cost product
l cost
n10Base;figchar=(;figbracket
val cx(153,157);R;Less than £1.50;I;£1.50 to £1.55;
+£1.56 to £1.60;£1.61 to £1.65;£1.66 to £1.70;More than £1.70=1.71+
n25;inc=c(153,157)
n12Mean price paid;figchar=£;figpre;dec=2
l product
col 130;Base;Brand A;Brand B;Brand C
The table that this code produces is:
Base Brand A Brand B Brand C
Base (20) (5) (6) (4)
Less than £1.50 17 5 4 4
£1.51 to £1.55 4 0 1 1
£1.56 to £1.60 3 2 0 1
£1.61 to £1.65 3 0 1 1
£1.66 to £1.70 4 2 1 1
More than £.70 2 0 1 1
Mean price paid £1.59 £1.60 £1.58 £1.63
If you specify figbracket but do not declare a fig-character, Quantum uses the ( symbol so that figures are enclosed in parentheses.
If you tabulate two axes that have different fig-characters and a cell results that has two fig-characters specified, the column character is printed and the row character is ignored.
If you import a table with fig-character into Excel (via q2cda), any value with fig-characters in it is treated as a text cell rather than a number cell.
See also
Introduction to axes