Fields – Numeric

The numeric field type is used to control the display of fields that will always contain numbers. It can be used to create an integer, double, currency, or slider field depending on which option is selected in the Numeric Type field.

Here is an example of how an integer, double, or currency will be displayed in the form:

Numeric user control field
A screenshot of a numeric field in trellispark, showing the blue label over an empty numeric box.

This is how a numeric slider will display in a form:

Numeric Slider user control
A screenshot showing a numeric slider in trellispark, showing the blue label above an incremented slider from 0 to 10, with the blue line set to the 5. There are arrow buttons on either side of the slider to allow it to be extended.

Below is an example of the Field Definition for a numeric field:

A screenshot of the field creation process for a numeric field in trellispark.

An XML Element Name is required to allow the values in this field to be saved to the database, with an indicator to determine if this numeric value should be required in its own form. The numeric may be used as a Lookup Field for more efficient searching in the database and could include a Default Value if necessary. There may also be an Empty Message, or a Tool Tip related to how this field should be filled in.

There are also Display Format, XSLT Format, and Mask fields to allow the user to define how this numeric should be displayed on the web page or in any XSLT documentation. A number of Decimal Places can be set and will automatically change any integer fields automatically into a double that will allow decimals to be stored. A Minimum and Maximum Value can each be defined to constrain the allowed values that can be entered into this numeric field. For most of the Numeric Types, these will be optional fields. If the Numeric Type is a slider, the Minimum and Maximum Value fields will be required to constrain the boundaries of the slider.

There are also Large Stepper and Small Stepper fields that are used to determine what the increments in a slider should be; a Large Stepper will be used for the larger increments with the Small Stepper denoting the number of notches between each larger increment.

The Auto Postback field allows you to specify if the page will refresh when the field is updated.

The Add unit specification field allows you to determine if the numeric field will display a combo-box with a list of units to select from. The units listed will be created by you in the Available Units field which is only visible when to option Yes is selected.

Decimal

Selecting “Decimal” as the Numeric Type will create a double field that can store a numeric value with one or more decimal places. The user can determine an appropriate number of decimal places to be filled in based on how specific their data should be.

As a backup, if a Decimal Place value other than zero is indicated for an integer, the field will still display as a double and allow the user to save numbers with the appropriate decimal places.

Currency

Currency fields are used specifically to denote monetary values within the trellispark framework.

Like an integer, a currency will need to have a set of formats to control how it is displayed on the page before it is saved, and how it will appear in XSLT documentation. This can be used to change currency labels and whether smaller increments, such as pennies on a CAD dollar, will appear.

These formatting choices can be controlled via regular expression (regex) or by using a mask.

Integer

Integers are another straightforward field, simply saving a number value to the Record XML.

Integers can have more specific formats than a regular string, with a Display Format to control how the value will appear on the page and a separate XSLT Format to control how the value will be shown in XSLT documentation. Integers can also have a set Maximum and Minimum Value to control the range of values that can be entered.

Slider

A slider is a new type of field within the .NET 5 framework, displaying a number value by moving a marker to the correct position on a slider. For a slider field, the Minimum and Maximum Value fields will become required fields to define the limits of this slider. The Large and Small Stepper fields will be used to create the markings along the length of the slider.

Updated on November 20, 2023

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment