When to Use a Number Field
A number field is used when the field in the ERP system contains a real number. This could be any number in the approximate range of ±5.0 × 10^−324 to ±1.7 × 10^308. Could contain quite a big number don’t you think?
So any real number can be stored in this field. Here are some examples, numbers after the dot . are the decimal digits.
- 1986
- -896.23
- 489474.68745
When the number field comes to our framework, it will be converted to a .NET double object. If it cannot be converted because it contains invalid characters like text, the framework returns an error. If it only contains whole numbers, you should consider using an integer field.
Configure a Numeric Text Box
In this section you will learn how to configure a numeric text box. First you will get information about the object field settings. The second part describes the view field settings.
Object Field
If you create a new number object field or method field, it is possible to change some type specific properties. Of course there are also a lot of generic properties like unique, external name or default value. Refer to common properties for more information about this topic.
- Click on the object.
- Create a new field.
- Change the type from Text to Number.
Minimum Value
The default minimum value is -1.79769313486232E+308. It is possible to override the default minimum value by checking the checkbox after the text box. In the figure below the value is changed to 0. This means that the value can’t be lower than zero and this will be checked in the ADM by the browser and by the framework in the back-end.
Maximum Value
The default maximum value is 1.79769313486232E+308. It is possible to override the default maximum value by checking the checkbox after the text box. In the figure below the value is changed to 10000. This means that the value can’t be higher than ten thousand and this will be checked in the ADM by the browser and by the framework in the back-end.
Interface Formatter
Refer to Interface formatter for more information about this topic.
View Field
A number field is displayed in the ADM by a special numeric text box. Depending on the view type there are different properties. The figure below shows an example of how the control will look like in the ADM. On the left the standard numeric control with arrow up and arrow down buttons. On the right the view field is configured with a mask, changing it to a masked text box with culture support.
Standard numeric control
View field configured with a mask
The following mask configuration is needed to achieve the mask above.
Multi Record View
Property | Description |
---|---|
Decimals | Specify the amount of decimals you want to see. Example: if the property is configured to see 2 decimals. 85.686 will be rounded to 85.69. 1 will be rounded to 1.00. |
Formatter | For more information: View formatter. |
Single Record View
Property | Description |
---|---|
Decimals | Specify the amount of decimals you want to see. Example: if the property is configured to see 2 decimals. 85.686 will be rounded to 85.69. 1 will be rounded to 1.00. |
Formatter | For more information: View formatter. |
Events | JavaScript events used to interact with the numeric text box. |
Create and Update View
Property | Description |
---|---|
Read Only | If checked the control could not be changed by the user. |
Use Data Source | For more information: Configuring a data source |
Mask | Refer to rules and literals. When a mask is used, the layout of the control will be changed to a Kendo masked textbox. |
Minimum Value | The minimum value is inherited from the method field. We advise not to break the inheritance and change the value on object level. In the ADM it is not possible to enter a value smaller than the minimum value. |
Maximum Value | The maximum value is inherited from the method field. We advise not to break the inheritance and change the value on object level. In the ADM it is not possible to enter a value bigger than the maximum value. |
Decimals | Specify the amount of decimals you want to see. Example: if the property is configured to see 2 decimals. 85.686 will be rounded to 85.69. 1 will be rounded to 1.00. |
Events | JavaScript events used to interact with the numeric text box. |
Formatter | For more information: View formatter. |