Edit documentation Edit document
GH-Elements

Number

Number is a gh-element that allows user to store and customize different number values. It accepts only digits, not letters. The values of this field are available for use in calculations.

Using the number element

This element accepts various types of values, including negative and decimal numbers. Together with the user settings, you can customize this element to suit your needs.

It is also worth noting that Number accepts a period instead of a comma for decimal numbers.

Functional Characteristics

The current gh-element has a large number of usages. As was said before, the current gh-element is used only for number values. This element can be stylized for any needs. For example that can be a field for price, currency exchange rate, or square footage, quantity, etc.

Also, regardless of the purpose of use, the values of this element can be used for calculations. Only values from this field can be used in the Calculator formulas.

Element Options

This gh-element has many options that allow you to customize the numbers to your liking. As most of others elements, number has two types of options.

Field Settings

Field settings contains the general number options. Most of them are unique. Only Field Name and Name space are standard.

Field settings of the number element

Name Description
Precision allows to choose how many signs will be after the point; details...
Multiple value allows to add multiple values; details...
Edit max min allows to change range of entry number; details...
Min minimum entry number; appears if Edit max min is on; details...
Max maximum entry number; appears if Edit max min is on; details...
Min digit count allows to set minimum number of signs in the entry field; details...
Prefix signs before number; details...
Suffix signs after number; details...

Precision

The first element setting allows you to set the precision of the stored value. That is that you configures how many decimal places will be always displayed in the field.

Using the max precision

There are four available options:

  • 0 - do not have any decimal places. This is a default value.
  • 0.0 - have only one decimal place.
  • 0.00 - have two decimal places.
  • 0.000 - have three decimal places.

That is, if the number of digits entered by the user is less than the number specified here, the blank space will be filled with a zero. For example, if you set three decimal places and user enters:

5.34

Then in the element will display:

5.340

This feature helps you adjust the element to the unit of measurement: pieces, dollars, meters, etc.

Multiple value

This is a setting that allows you to set how many values an element can store. That is, if it is enabled, the current field will take a multiple value.

Using the multiple setting

This setting changes the appearance of the element. Each of the values is displayed in separate blocks. A button also appears that allows users to add new values.

When this function is used, user needs to press the Enter key after entering the number to save the value.

Edit Max Min

The current setting have not much influence on the work of the element. It is responsible for the limit of filtering the current element. Namely it allows to configure only one filter called Between.

Using the configured filter

So, in general, if it is enabled, the minimum and maximum filtering will be available for editing. Otherwise, the settings for editing them are not even displayed.

Min

This is the setting that allows you to set the minimum number of the filtering the current element. Here you just need to enter a number that is less than its maximum value.

The default value is 0 (zero).

It's worth mentioning that you can enter absolutely any number, regardless of what you selected in the selected precision. Together with the next setting, this is only available if Edit Max Min is enabled.

Max

Similar to the previous option, this one allows you to set a limit for filtering numbers. Namely, it configures the upper limit. Here you can enter any number greater than the minimum for the maximum value.

The default value is 100.

You can enter any value here, even decimal numbers, regardless of the value of Precision. This setting appears only if the Edit Max Min is enabled.

Min Digit Count

In addition to setting the number of decimal places, there is another setting that adjusts the number of digits. The current setting allows you to configure the minimum number of digits in a value.

Configured the minimum digit count

By default, this setting is -1.

This setting can be used for generating IDs. It also cannot be used with Precision other than the default value.

Prefix

The current setting is responsible for the characters before the value. This means that you can specify any character or word to be displayed in the field. This is used to label currency or anything else.

Setting the prefix

The prefix is not part of the value. It only appears in the element and is not stored in the field value.

Suffix

The current setting is quite similar to the previous one. It allows you to set any character or word at the end of the field. Here you can specify the units of measurement of the value or anything else.

Using the suffix

As with the previous setting, the suffix is not stored in the field value. Because it is not a part of it. It is displayed only in the field.

Default Value Settings

This group of options contains settings of the field default value.

Default value settings of the number element

Name Description
Use default value allows to use default value; details...
Use counter allows to use counter as a default value; appears if Use default value is on; details...
Default value allows to set default value; appears if Use default value is on; details...
Default counter allows you to set the number from which the counter will starts; details...

Use Default Value

This is the main setting of this block. If it is enabled, all other settings will appear. But in general, this setting allows you to use the default values.

To be more precise, Use Default Value allows you to apply all the changes from the following settings. So if this setting is off, then even if the following options are configured, they will not be used.

Use Counter

The current setting allows you to enable the counter. That is, the current element will be filled with a certain sequence number. This way, each newly created item will have a unique identifier by default.

This option simply allows you to use a counter. In turn, the Default Counter is used to set the initial value of the counter. And this setting is only available if the Use Counter is enabled.

Default Value

This setting is directly related to the Use Default Value. It allows you to set a specific value that will be used by default. That is, when the user creates an item, the current field will be automatically filled with the current value.

It is also important that when you fill in this setting, you make sure that you do not turn off Use Default Values. Without this setting, the current will not work and will not even be displayed.

Default Counter

This is a setting that allows you to set the initial count value. That is, the first item user creates will automatically be filled with the current value, and the next one will have a value that is one more.

This setting is not available if the Use Counter and Use Defaults Value are disabled.

Element Style

The number elements do not have unique options for styles, so you can read about general ones in Setting Overview and below about Interpretation.

Style of the number element

Filtration

For filtering number elements you can use such filters:

Interpretation

As elements of text, numbers have the same interpretation in different places.

Interpretation types of number

And also, it has a bit differences between multiple and single value interpretations.

Interpretation types of multiple values of number

Default

The default type is editable either for single value or multiple ones.

Plain Text

Plain text is an interpretation type that allows only displaying field values and makes field uneditable.

Value

Displays the value of the element field.

Value Format

Despite number is a string, it accepts any letters and signs except minus and dot.

{
    "field_value": "-3.00"
}

That is because of their conversion to a numeric data type.

Data Model

Number is quite understandable element. But it also has considerable quantity of settings. Its data model looks like this:

{
    "data_model": {        
        "default_counter": 1,
        "default_field_value": 1,
        "interpretation": [],
        "min_digits_count": -1,
        "multiple_value": 0,
        "precision": "0",
        "prefix": "",
        "range": {
            "min": 0, 
            "max": 100
            },
        "regular_expression": "\\d+(.d+)?$",
        "show_min_max": 1,
        "suffix": "",
        "use_counter": false,
        "use_default_value": 1
    }
}
Name Type Description
default_counter number contains a default value for counter
default_field_value number contains a default value for field
interpretation array contains all number interpretations
min_digits_count number minimum number of signs in the field
multiple_value boolean allows you to add multiple values to the field
precision string allows to set the number of characters after the point
prefix string contains signs that will be before number in the field
range object contains limits of number that can be in the field
min number contains the minimum value that can be in the field
max number contains maximum value that can be in the field
regular_expression string contains a regular expression that checks if the format of the value is correct
show_min_max boolean allows to edit min and max values
suffix string contains signs that will be after number
use_counter boolean allows to use counter values
use_default_value boolean allows to use default value