Or just use numberFormat(01011+7, "00000") in your expression to repad
the athimetic result with zeros.

cheers,
barneyb

On 2/16/06, Dave Watts <[EMAIL PROTECTED]> wrote:
> > I have the code below doing this where 01011 is a zip code.
> > So I would like the output to be 01018 as the appended value
> > in the array but right now I am getting 1018 (leading 0
> > getting cut off) I tried listappend and it does the same
> > thing. Val() and tostring() didn't seem to do much either. Any ideas?
> >
> > ArrayAppend(myArrayList2,01011+7);
>
> CF doesn't keep leading zeros for numeric values. You're treating the zip
> code as a numeric value, by using it as an operand in numeric addition. So,
> naturally, you're losing the leading zero. Offhand, I'm not sure how I'd go
> about doing this - you don't typically use zip codes in numeric operations -
> but you could write a function that performs the numeric addition, then
> checks the length of the value to see if it's four or five digits. If it's
> four, you can reasonably assume that the first character was a zero before
> the addition. You could then plop it back on the front of the value.
>
> Dave Watts, CTO, Fig Leaf Software
--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232550
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to