You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by John Cheesman <jo...@stratasoftware.com> on 2008/11/27 18:04:24 UTC

String to Int

Hi,

Can I do string to Int conversion in velocity?

I have string properties that contain integers and I want to sum them,

Thanks

John


Re: String to Int

Posted by Nathan Bubna <nb...@gmail.com>.
Google could tell you this:
http://www.google.com/search?q=velocity+convert+string+to+int

#set( $Integer = 0 )
$Integer.parseInt($string)

or use the MathTool (from VelocityTools 1.x and 2.x)
$math.toInteger($string).intValue()

On Thu, Nov 27, 2008 at 9:04 AM, John Cheesman
<jo...@stratasoftware.com> wrote:
> Hi,
>
> Can I do string to Int conversion in velocity?
>
> I have string properties that contain integers and I want to sum them,
>
> Thanks
>
> John
>
>

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