Numeric Output State Variable Reference

Table of contents


Introduction

Numeric output state variables represent numbers displayed to the user. Each rendered component will display according to the format specified in the state variable.

Constructor

Syntax

ctl.createPage({
	...,
	stateVarInfo:[
		{type:'numericOutput', ...},
	],
})

Parameters

Note: If the info.id contains a subName (e.g., 'myPage_mySv_kg'), it will be considered a unit specifier. If the Component has the showUnits attribute, the unit abbreviation for the unit subName will be displayed after the number.


Instance methods

Inherited methods

val([value])

Gets or sets the value. A value that is not a finite number, NaN, or an Error (for example, undefined, null, or a string) is logged and stored as INVALID_NONE. The value is passed through fmt.apply() before being stored.

fmtVal()

Returns the value formatted by the format. Returns '-' if the value is outside the format's range (the condition is logged), or the Error text if the value is an Error.

isValid([value])

True if the OutputSv test passes and the format's isValid(value) passes.

Note: The component() method returns a NumOutputSvCmp.


Instance properties

Inherited properties


childSv.fmt

A NumFmt instance specifies the numeric format. The instance is held in the child state variable childSv.fmt (a modelObject); read it as sVar.childSv.fmt.value. Unlike numericInput, a numericOutput has no fmt, min, or max properties and applies no limits other than those in the format.

Value

A NumFmt instance.


isNumber

Always true for numericOutput.

Value

A Boolean.


isUnit

True if the state variable has a unit subName.

Value

A Boolean.


unit

The first subName. For example, 'kg' if the state variable ID is 'myPage_mySv_kg'.

Value

A String.


Component attributes

Inherited attributes


fmt

A NumFmt instance or format string that overrides the state variable's format for this component only.


DOM element properties