Skip to content

rife.render.FormatCreditCard

Erik C. Thauvin edited this page Mar 18, 2023 · 1 revision

Formats a template credit card number value to the last 4 digits.

The number must satisfy the Luhn algorithm. Non-digits are stripped from the number.

Usage

<!--v render:rife.render.FormatCreditCard:valueId/-->
{{v render:rife.render.FormatCreditCard:valueId/}}

Sample

Template

Credit card ending in <!--v render:rife.render.FormatCreditCard:ccnumber/-->

Code

template.setAttribute("ccnumber","5130-3899-9169-8324");

Output

Credit card ending in 8324