Display format for numeric variables
Updated 30 Aug 2024
After you define numeric and numeric list variables and insert them in item content, you can preview variable values to see the randomized numeric values as students might see them (Standard View Randomized).
- By default, the values in numeric variables display to their full calculated precision (up to 8 digits) in student view. For values where less than 8 digits conveys full precision, less digits are shown.
- For example, if you define the variable "mass" with a minimum of 1.00 and a maximum of 5.00 using a step of 0.5, the value will display to 1 digit for 1 g, but two digits for 1.5 g.
Some sample values with their full calculated precisions are shown here.
Value | Default numeric display (full precision) |
---|---|
pi | 3.1415927 |
2 | 2 |
Round (pi, -4) | 3.1416 |
sigdig (1234.5, 3) | 1230 |
1.001 | 1.001 |
Change from full-precision display for numeric variable values
Enter one of the following formats in the Format box of the Define Variable form.
How to open the Define Variable form
Open the item in the Simple Editor and select Variables from the top toolbar. Then, choose either the Define New Variable link or, for an existing variable, choose Edit.
This format controls only the display of numeric values for that variable when viewed in the item by students, such as in a part question.
- The full-precision numeric value is still used if the variable is used in any calculation. If a value needs to be truncated to a specific number of digits, see Define numeric variables with functions for information about sigdig, round, and other functions.
- Although the Format setting in the variable definition doesn't affect the variable value used for calculations, note that these same formatting conventions are used for optionally changing the default 3 significant figures for answers—which does affect the final answer during grading. How to set significant figures for numeric answers
Format | Sample display for 1234.5 | Meaning |
---|---|---|
# | 1235 | Integer format. Rounds the value to the nearest integer. |
#. | 1235. | Integer format with trailing decimal point. |
#.# | 1234.5 | Floating point with 2 digits of precision. Additional digits of precision are added by providing more pound signs to the right of the decimal. For example, #.## produces 1234.50. |
#.##E+00 | 1.23*10^03 | Scientific notation (same rules for digits of precision as for floating point, described above). The E+00 portion specifies the minimum number of digits for the exponent. To increase the number of exponent digits, add more zeros (for example, E+000). |
{2} | 1200 | Round and display to 2 significant figures, using loose significant figure conventions. (For information about loose sigfig conventions, see Significant figures and grading tolerance.) |
[2] | 1.2*10^3 | Round and display to 2 significant figures, using tight significant figure conventions. (For information about tight sigfig conventions, see Significant figures and grading tolerance.) |
[2.] | 1.2*10^3 | See information about trailing-dot notation in Significant figures and grading tolerance. |
See also: