If you are sure the number you increment contains 2 characters (Less
then 100) you can use this code. This can have any number of dots in the
project number.
<cfscript>
firstnum = ListDeleteAt(form.proj_num,ListLen(form.proj_num,"."),".");
lastnum = ListLast(form.proj_num,".");
lastnum = lastnum + 1;
newproj_num = firstnum & "." & NumberFormat(lastnum,"00");
</cfscript>

if your last number can exeed 100 and you have to have at least two
characters, replace the last line by:
mask = "00";
for(i=3;i LTE Len(lastnum);i=i+1) mask = mask & "0";
newproj_num = firstnum & "." & NumberFormat(lastnum,mask);

On
 Mon, 29 Oct 2001, Paul Ihrig wrote:

> ok
> i can do this
> 
> <cfoutput>
> <cfset firstnumber = listfirst(#FORM.Proj_Num#,".")>
> <cfset lastnumber = IncrementValue(listlast(#FORM.Proj_Num#,"."))>
> <cfset MyNum = "#firstnumber#.#lastnumber#">
> <CFSET Proj_Num2 = #MyNum#>
> </cfoutput>
> 
> But how do i make it insert 01 instead of 1?
> 
> -paul
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to