Re: File format contains the fixed size s# with left padded 0, can we do this in Velocity?

2005-03-18 Thread Christoph Reck
You can also use plain VTL: #set( $id = $number ) #set( $len = $id.length() - 4 ) $id.substring($len) To simplify the use, you can create a macro for this: #macro( fourdigits $number )#* *##* #local( $id $len ) *##*-- optional directive, avoids polluting context *##set( $id =

Re: File format contains the fixed size s# with left padded 0, can we do this in Velocity?

2005-03-12 Thread Gagan 007
Thanx chen , i will look check this jian chen [EMAIL PROTECTED] wrote:You could use the jakarta commons library. The actual file is: org.apache.commons.lang.StringUtils. It has various padding methods. Just pass the StringUtils into velocity context. Cheers, Jian On Fri, 11 Mar 2005 11:21:07

Re: File format contains the fixed size s# with left padded 0, can we do this in Velocity?

2005-03-11 Thread jian chen
You could use the jakarta commons library. The actual file is: org.apache.commons.lang.StringUtils. It has various padding methods. Just pass the StringUtils into velocity context. Cheers, Jian On Fri, 11 Mar 2005 11:21:07 -0800 (PST), Gagan 007 [EMAIL PROTECTED] wrote: I have to show some