Formats a credit card number.
Attributes
Attributes | Description |
---|---|
| Automatic Set to true or false to indicate whether to format this value as a credit card. |
| The masking character. The default character is |
| The number of characters to unmask, from right to left. |
| The number of characters to group within the credit card string. |
Usage Notes
You can display a credit card number as a series of number groupings. You determine the number of items in each grouping by setting the groupingsize
attribute. For example:
<dsp:valueof bean="CreditCard.number"converter="CreditCard" groupingsize="4"/>
This example might render a credit card number with four numbers in each grouping as follows:
7845 5624 5586 1313
In general, you should display the entire credit card number only when it is initially entered, in order to facilitate confirmation. Afterward, you typically display only a portion of the number, so users can recognize it while ensuring confidentiality. You can control number masking with two attributes:
numcharsunmasked
: The number of digits to unmask from right to left.maskcharacter
:
For example:
Tag | Result |
---|---|
|
|
|
|