Number Field Tag Attributes
format
Controls the format of the number field to either dollar, decimal or percent. The following values can be entered:
- DOLLAR—Sets the format of the number field to include the appropriate currency sign, a decimal point, and commas. For example,
42000
is formatted to$42,000.00
after the user saves the record.
Form |
|
Block |
|
This attribute displays the symbol of the system default currency in all object records except contacts, where it displays the symbol of the currency selected for that contact.
When used for custom fields of type Number in invoices that are entered in the original currencies different from the system default currency, this attribute will not reflect the currency symbol of the invoice.
-
DECIMAL—Sets the format of the number field to include a decimal point and commas. The number of zeros after the decimal point depends on the values of two other attributes:
minimumFractionDigits
is used in cases where you wish to show digits to the right of the decimal point even when the rightmost decimal place(s) contain zero.maximumFractionDigits
is used in cases where you wish to store no more than a specified number of decimal places. If the user types more than the specified number of decimals, the result is rounded to the specified number of decimals.
If either of these attributes is not specified, the attribute's default number of decimal places is 2.
The value of maximumFractionDigits
must not be specified as less than the value of minimumFractionDigits
.
Form |
|
Block |
|
For example, if the user types 42000 into field "Salary", above, the user input 42000
is formatted to 42,000.00
(default 2 decimal places) after the user saves the record.
An additional example: In the "Rate" field shown above, if the user types 37.1, it is formatted at save time to 37.100 (the minimum of three decimals applies in this case.) If the user types 37.10046, the field is formatted to 37.1005 (the maximum of four decimals applies in this case, and rounding is used.)
- NONE—Sets the format of the number field to use no formatting, such as a decimal point and commas. For example, if a number field is set to NONE, the user input
1501082006
is not formatted with commas and appears exactly as it is entered.
Form |
|
Block |
|
- PERCENT—Sets the format of the number field to round the decimal to the nearest integer and to include the percent sign. For example, if a number field is set to
PERCENT
the user input45.75
is formatted to46%
after the user saves the record.
Form |
|
Block |
|
size
Controls the width of number fields by specifying the number of numeric characters for the field. For example:
Form |
|
Block |
|
maxlength
Limits the maximum number of characters a user can enter in number fields. Set the attribute value to a number to represent the maximum number of numeric characters allowed. For example:
Form |
|
Block |
|
onFocus="javascript:blur();"
Prevents users from entering data into the number fields. This attribute is used with business rules and JavaScript. For example:
Form |
|
Block |
|
The same rules apply to including multiple attributes for a tag. For example, the custom field Salary can have the attributes format
, size
, and maxlength
. See the example in maxlength.