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
2010-01-28 17:42:01
hi thanks its working fine.
uma
2010-01-29 16:28:17
Glad I could help!
Quotidian
2010-01-29 17:03:53
Thanks, works fine and cured the headache.
Matt
2010-05-26 12:21:43