Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to show just last four digits of credit card number? 2

Status
Not open for further replies.

leadman

Programmer
Jun 11, 2001
177
0
0
US
How do I show or save just the last four digits of "form.cardnum" (a credit card number) ?
 
Use:
Code:
Right(form.cardnum, 4)

That should do the trick. Kevin
slanek@ssd.fsi.com
 
Also, to make it look even more realistic
( ************0123), I once used

<CFOUTPUT>
<CFSET stars=#LEN(cardnum)# - 4>
<CFLOOP from=&quot;1&quot; to=#stars# index=loop>
*
</cfloop>
<CFLOOP from = #loop# to=#LEN(cardnum)# index=loop2>
#MID(cardnum,loop2,1)#
</cfloop>
</cfoutput>

Thtere's probably better ways, but hey-ho!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top