Referenceinteger

<integer>

An integer value

<integer> is a Math component that rounds its content to the nearest integer.

Attributes and Properties

Attributes for <integer>

Number display (5)
avoidScientificNotation

boolean. Default value: false. Whether to render numbers in full decimal form rather than scientific notation.

displayDecimals

integer. Default value: 2. Number of decimal places to display when rendering this number.

displayDigits

integer. Default value: 3. Number of significant digits to display when rendering this number.

displaySmallAsZero

number. Default value: 1e-14. Threshold below which numbers are displayed as zero.

padZeros

boolean. Default value: false. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Positioning (2)
anchor

point. Default value: \(\left( 0, 0 \right)\). Coordinates of the anchor point used to position this component on a graph.

positionFromAnchor

keyword. Where this component sits relative to its anchor point.

ValueDescription
upperRightPlace the component above and to the right of the anchor point.
upperLeftPlace the component above and to the left of the anchor point.
lowerRightPlace the component below and to the right of the anchor point.
lowerLeftPlace the component below and to the left of the anchor point.
topPlace the component directly above the anchor point.
bottomPlace the component directly below the anchor point.
leftPlace the component directly to the left of the anchor point.
rightPlace the component directly to the right of the anchor point.
center (default)Center the component on the anchor point.
Other (5)
convertBoolean

boolean. Default value: false. Whether to convert boolean inputs to 1/0 instead of NaN.

draggable

boolean. Default value: true. Whether the number can be dragged on a graph.

layer

number. Default value: 0. Z-order layer index when shown on a graph.

renderAsMath

boolean. Default value: false. Whether to render the number using math typography.

valueOnNaN

number. Default value: NaN. Numeric value to use when the input cannot be parsed.

Common to all components (9)
copy

reference. Create an independent copy of another component by reference. Enter a references a $name.

disabled

boolean. Default value: false. Whether this component is disabled and cannot be interacted with.

extend

reference. Extend another component by reference, inheriting its children and attributes. Enter a reference as $name.

fixed

boolean. Default value: false. Whether this component's value is fixed and cannot be modified.

fixLocation

boolean. Default value: false. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

hide

boolean. Default value: false. Whether to hide this component from the rendered output.

isResponse

boolean. Default value: false. Whether this component is treated as a response for the purposes of assessment.

name

text. The name used to reference this component from elsewhere in the document.

styleNumber

integer. Default value: 1. The style number used to select this component's visual styling from the available style definitions.

Properties for <integer name="i">

Number display (5)
$i.avoidScientificNotation

boolean. Whether to render numbers in full decimal form rather than scientific notation.

$i.displayDecimals

integer. Number of decimal places to display when rendering this number.

$i.displayDigits

integer. Number of significant digits to display when rendering this number.

$i.displaySmallAsZero

number. Threshold below which numbers are displayed as zero.

$i.padZeros

boolean. Whether to pad displayed numbers with trailing zeros to fill the requested digits/decimals.

Positioning (2)
$i.anchor

point. The coordinates where this component is anchored on the graph.

$i.positionFromAnchor

text. Where this component sits relative to its anchor point.

Other (14)
$i.backgroundColor

text. Human-readable name for this component's background color, derived from the active style and theme.

$i.disabled

boolean. Whether this component is disabled and cannot be interacted with.

$i.draggable

boolean. Whether the number can be dragged on a graph.

$i.fixed

boolean. Whether this component's value is fixed and cannot be modified.

$i.fixLocation

boolean. Whether this component's location is fixed (preventing it from being moved while still allowing other modifications).

$i.hidden

boolean. Whether this component is hidden from the rendered output.

$i.latex

latex. The number rendered as LaTeX.

$i.layer

number. Z-order layer index when shown on a graph.

$i.math

math. The number's value as a math expression.

$i.renderAsMath

boolean. Whether to render the number using math typography.

$i.text

text. The number rendered as plain text.

$i.textColor

text. Human-readable name for this component's text color, derived from the active style and theme.

$i.textStyleDescription

text. Human-readable description of this component's text styling (color and any background color).

$i.value

integer. The integer value.

Common to all components (4)
$i.doenetML

text. The DoenetML source code that produced this component.

$i.hide

boolean. Whether to hide this component from the rendered output.

$i.isResponse

boolean. Whether this component is treated as a response for the purposes of assessment.

$i.styleNumber

integer. The style number used to select this component's visual styling from the available style definitions.

Examples

Example: <integer> of nested number

The named <integer> stores the enclosed number as the nearest integer value.


Example: <integer> of user-input

The named <mathInput/> is stored by the <integer> component as the nearest integer value.