在速度模板中将String转换为Float
问题描述:
我怎么能将字符串转换为浮点数....由于float.parseFloat()
在Apache速度下不起作用....
how wud i be able to convert string into float.... as float.parseFloat()
is not working in apache velocity....
#set($sum = 0.0)
#set($Float = 0.0)
#set($intString = "2.2")
#if($!intString)
#set($sum = $sum + $Float.parseFloat($intString))
#end
this is not working in velocity..
答
sum = 0 .
sum = 0.0) #set(
Float = 0 . 0 ) #set(
Float = 0.0) #set(
intString = " ) #if(
intString = "2.2") #if(