velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Reck <apa...@recks.org>
Subject Re: Conversion Problem.
Date Wed, 21 Jan 2004 14:03:22 GMT
Simply do something like:

#set( $int = 1 )
#set( $string = "123" )
#set( $myInt = $int.valueOf($string) )
A string converted to integer: $myInt

See more on the JDK ApiDocs, e.g. at:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Integer.html#valueOf(java.lang.String)

You can use any public method of your context values (which are java class instances).

Cheers,
Christoph

Raman Jee wrote:
> Hi,
> How type conversion handled in VTL.
> Is it possible to convert from Sting to Integer. ??
> 
> Regards
> Raman Jee Mishra
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message