velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergiu Dumitriu <ser...@xwiki.com>
Subject Re: String to Number/Integer
Date Tue, 05 Jul 2011 15:19:05 GMT
On 07/05/2011 11:09 AM, LaStudent wrote:
>
> Hello,
>
> is it possible to convert a String to a Number?
>
> something like this:
> #set($tmpStr = "14")
> #set($tmpInt = parseInt($tmpStr))
>
> best regards

Not directly, but there's a tool for that:

http://velocity.apache.org/tools/devel/javadoc/org/apache/velocity/tools/generic/ConversionTool.html#toInteger%28java.lang.Object%29

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/

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


Mime
View raw message