Try this:

<cfset var1 = 1234>

<cfoutput>#NumberFormat(var1,'0000')#<br /></cfoutput>

<cfset var1 = 123>

<cfoutput>#NumberFormat(var1,'0000')#<br /></cfoutput>

<cfset var1 = 12>

<cfoutput>#NumberFormat(var1,'0000')#<br /></cfoutput>

<cfset var1 = 1>

<cfoutput>#NumberFormat(var1,'0000')#<br /></cfoutput>

Notice that NumverFormat pads the numbers with elading zeroes.  This is just
a test to demonstrate usage.

Teddy

On 10/13/06, Adkins, Randy <[EMAIL PROTECTED]> wrote:
>
> Depending on the data type of the variable / database field, it will.
> If the field is set top number or integer, all leading 0s will be
> dropped.
> The DB field will need to be CHAR or VARCHAR
>
> -----Original Message-----
> From: Will Tomlinson [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 13, 2006 1:39 PM
> To: CF-Talk
> Subject: Why does CF remove my leading 0's??
>
> This is driving me nuts!
>
> No matter what I do, CF gets rid of a much-needed leading 0 in the last
> 4 digits of a CC #.
>
> The variable looks good before sending it into a CFC, then I dump the
> arguments, and the leading 0 is gone. I have the argument type set to
> string.
>
> <cfargument name="last4digits" type="string">
>
> What do I do about this? Or what am I doing wrong?
>
> Thanks,
> Will
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256728
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to