<cfset test = rereplace(myNumber,"([0]*)([0-9]*)","\1","ALL") &
val(myNumber+1)>

Marlon

-----Original Message-----
From: brobborb [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 3:08 PM
To: CF-Talk
Subject: Padding Zeros

Hey guys, i'm writing an app that looks at the previous name of an item, and
increments +1 to the next item....

example, if the first item is 4763, then the next item would be 4763, then
4764, then 4765 and so on until it reaches some condition.

The problem is when the item is something like 0004763 (it could happen
anytime at different times), then it would name the next one as 4764, then
4765 and so on.

I would like it to retain the zeros.  Is there a way to do this, when I
don't know if the item number will have zeros in the front or not?

Thanks!
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to