Setting Properties of Number Attributes
The Number attribute type represents floating point and decimal numbers. Most properties you need to specify for attributes of the Number type are common to all attribute types – see Common Properties. The properties specific to the Number type are:
Format
The format basically indicates whether the number may have decimal point and also how many digits should be displayed before and after the decimal point. The format is specified as a text string with special symbols. The allowed special symbols are described in the Appendix C. You can specify the format directly or click on the “…” icon of the property to bring up the “Number Format” dialog. The following settings can be specified on this dialog:
Number of digits before decimal point
If “Automatic” is selected (this is the default option) the number of digits before the decimal point is not limited; there will be as many digits displayed before the decimal point as the number has. If you specify a particular value instead of selecting the “Automatic” option the number of digits before decimal point will always be equal to this value. If the number has fewer digits than the value specified, the remaining digits will be displayed as zeroes. For example if you specified 4 as the number of digits before the decimal point, number 10 will be represented as 0010.
Number of digits after decimal point
If zero is specified (the default) the number represents an integer and no decimal point will be displayed. If some non-zero value is specified the number will be displayed with the specified number of digits after the decimal point padded with zeroes if necessary.
Custom format
Type the symbols directly into the text box according to the conventions described in Appendix C.
Min. value / Max. value
If specified indicates the upper and/or lower limit that the value represented by the number may take (both are inclusive). Note that it is possible to indicate both upper and lower limits, lower limit only, upper limit only or no limits at all.
Auto Incremented
If this property is defined Aware IM will automatically set values of this attribute incrementing by 1 every time a new instance of the object that owns the attribute is created. The benefit of using auto-incremented numbers compared to incrementing numbers by rules is that the auto-incremented number is set into the database immediately without waiting for the current database transaction to commit. This avoids the potential problem of having two users having the same number if numbers need to be unique.
When you click the “…” button of the property you can control how auto-incremented numbers are applied:
Auto-increment every object instance
This is the default option. Every time the new instance of the object is created the number will be incremented by 1.
Auto-increment within a group of object instances
Sometimes it may be necessary to increment numbers within a “group” of instances. For example, you may want to have invoice numbers automatically incremented for customers from different countries. Every country may have its own group of numbers. In this case you select this option and then select the attribute of the object that identifies a “group”, for example Country.
Initial Value
This determines the value for the first instance of the object or the first instance of the “group” of instances. The default value is taken from the Value Range defined for the number (if undefined 1 is used). You can also specify an attribute that will hold the initial value.
note
Aware IM increments values of numbers that do not involve groups of instances BEFORE rules are evaluated for the object, so if rules use auto-incremented attributes, their values will already have been calculated. However, if auto-incremented attributes involve group instances their values are incremented AFTER rules are evaluated. If you have to use incremented values for such attributes in rules, set the auto-incremented values “manually” using theNEXT_SEQUENCE_NMB
function, for example:
IF Order.RefNo IS UNDEFINED THEN Order.AutoIncremented = NEXT_SEQUENCE_NMB('Order', 'AutoIncremented', Order.GroupValue) Order.RefNo = 'Order Prefix ' + OrderAutoincremented
.
Presentation Options
Some common presentation options, such as “label” and description are described in Common Properties. You can also define the following properties for the Number attributes:
Widget
Most of the choices here are similar to the Plain Text attribute – “Text box”, “Combo-box”, “Radio buttons” and “Checkboxes”. If the number has “Min. value” and “Max. value” defined there is also an option to display the number using a slider or a rating widgets. For the slider you can then specify the orientation, the increment value and whether to display a tip.
Note that the Rating widget can be displayed not only on forms but also in standard and custom queries. To display rating number as stars in a standard query go to the properties of the corresponding column and tick the “Display rating widget” checkbox. To display rating as stars in a custom query refer to the attribute in a custom template like so: {AttributeName,rating}
Spinner
This checkbox indicates whether or not to generate a spinner control when displaying the number attribute.