You can use the sigform() and decform() functions to display numeric values to a specified number of significant digits or decimal places.
- sigform()
- Displays a value rounded to the specified number of significant digits. If
needed,
e
notation is used. - decform()
- Displays a value rounded to the specified number of decimal places.
Note If your answer key uses
$SIGFIGS
or $DECFIGS
to
require a specified precision, the answer key will be displayed to the correct
precision automatically without using the sigform() or
decform() functions. Example Question Using sigform()
The following table summarizes an actual question.
QID |
|
---|---|
Name |
|
Mode |
|
Question |
|
Answer |
|
Display to Students |
Example Question Using decform()
The following table summarizes an actual question.
QID |
|
---|---|
Name |
|
Mode |
|
Question |
|
Answer |
|
Display to Students |
Tip For known constants, you can enclose the value in single quotes to
store both the value and the precision with which you specified it. For example,
$e = '2.718';
assigns a value to $e with four significant
digits.