You could probably use format macro for formatting the number...

http://www.atlassian.com/software/jira/docs/api/3.1.1/com/atlassian/jira/uti
l/velocity/NumberTool.html
http://www.opensubscriber.com/message/velocity-user@jakarta.apache.org/14631
34.html


Thanks & Regards,
 
Nitesh
_____________________________

Disclaimer: 
Information contained and transmitted by this e-mail is confidential,
proprietary, and legally privileged data of Cordiant Technologies that is
intended for use only by the addressee. If you are not the intended
recipient, you are notified that any dissemination, distribution, or copying
of this e-mail is strictly prohibited and you are requested to delete this
e-mail immediately and notify the originator. Any views expressed by an
individual do not necessarily reflect the view of Cordiant Technologies. The
recipient should scan this email and any attachments for viruses as Cordiant
Technologies is not liable for the presence of viruses in this email.
Cordiant Technologies does not accept liability for any errors or omissions
as the internet communications cannot be guaranteed to be timely, secure,
error or virus-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete. 

To know more about Cordiant Technologies, please visit
http://www.cordiant.com
_____________________________


-----Original Message-----
From: Lucas Bern [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 06, 2005 8:20 AM
To: Struts Users Mailing List
Subject: Re: Velocity Question


HI!
I´m not sre what you mean... but....
StringUtils is not  an abstract class, so you could put in the context of
Velocity an instance of StringUtils.... velContext.put("StringUtils", new
StringUtils() ); In your template...
 
$StringUtils.leftPad( $car.id, 6, '0') $StringUtils.leftPad( $car.na000me,
15, ' ')
 
wish it helps...
 
Lucas
 


Vinicius Caldeira Carvalho <[EMAIL PROTECTED]> escribió:
Sorry for the OT. But since they're kinda related ... Does velocity provides
a way to fill gaps on my variables? Translating... I have a pojo car, which
has ID and Name Id must have size 6 with zero left padd, and Name 15 with
with white spaces padding. Now let's suppose I have:

Car beetle = new Car(1,"beetle");
When printing:
$car.id $car.name
I get
1 beetle
When the desirable would be:
00001 beetle

This is for reporting purposes

Thanks all



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to