Follow

Decimal & Integer

The Decimal and Integer controls are meant to display a numeric value which can be formatted.

Like almost all SPARK controls, you can trigger events that are fired when the user interacts with the control (see the Event and Methods sections below and the Event Handling article for more information).

This article will discuss the decimal and integer control together since these two controls have very similar properties.

Formula

The Value Formula option allows you to control the value displayed in the control. You can display static values or use formulas/aggregate functions (see the Formulas article here for additional information).

Appearance for both Decimal and Integer

Width in px, %, and em values

Size Style Default, Large, Small

Label Placement Top, Left

Behavior for Decimal

Tab Index Allows you to control the order of tabbing within a page. It's important to note that tab indices start at 1, instead of at 0.

Placeholder Text Filler text until user inputs text

Thousands Separator Commas are commonly used as separator, you can use other separators instead of commas.

Decimal Separator Periods are commonly used as separator, you can use other separators instead of periods.

Decimal Places The amount of decimal places (eg. 2)

Prefix  Fixed character(s) in the first position of the control

Postfix Fixed character(s) in the last position of the control

Behavior for Integer

Tab Index Allows you to control the order of tabbing within a page. It's important to note that tab indices start at 1, instead of at 0.

Placeholder Text Filler text until user inputs text

Thousands Separator Commas are commonly used as separator, you can use other separators instead of commas.

Prefix  Fixed character(s) in the first position of the control

Postfix Fixed character(s) in the last position of the control

Example(s)

These are the configuration option settings for the Decimal control...

This is the result...

The Value Formula is attached to the Total Decimal control and takes the input from Value1 and Value2 and adds them together.

These are the configuration option settings for the Integer control...

This is the result...

Events

With the Decimal and Integer controls, there are 5 types of event handlers:

  • On Load When the page loads
  • On Change When there is a change
  • On Focus When the user enters the control field
  • On Blur When the user exits the control field
  • On Format Overriding the formatting of a number, e.g. a negative value could be displayed in red and in parenthesis

You can use JavaScript logic to affect the effects of the control, depending on the event. More information on using these controls can be found in the Event Handling article.

Methods

For detailed information on the available methods for these controls, , access the JS Doc file for the Decimal control or access the JS Doc file for the Integer control.

Related Article(s)

Formulas

Data Binding & Retrieval

 

  • Author: Lisa Leung
  • Date Created: June 3, 2015
  • Date Modified: February 15, 2016
Was this article helpful?
0 out of 0 found this helpful

Comments