tags:

views:

708

answers:

2

i have a velocity template file which has the data from xml. I want to convert the string into integer type. can anyone help me to find out the solution.

+8  A: 

Aha! Been there.

#set($intString = "9")
#set($Integer = 0)
$Integer.parseInt($intString)

Doing this uses the java underlying velocity. The $Integer variable is nothing more that a java Integer object which you can then use to access .parseInt

Quotidian
hi thanks its working fine.
uma
Glad I could help!
Quotidian
Thanks, works fine and cured the headache.
Matt
A: 

Thx dude you saved my life

Levent