私の速度のバージョンは私のVMファイルで作業していない変数の乗算がMulitiplication操作は、Velocityテンプレートで作業していない
foreach($entry in ${ctx.order.entries})
#if(${entry.quantity})
#set ($pQty = ${entry.quantity})
#end
#if(${entry.product.weight})
#set ($prodWeight = ${entry.product.weight})
#end
#if(${pQty} && ${prodWeight})
#set ($totalWeight = $pQty * $prodWeight)
#else
#set ($totalWeight = 0)
#end
<tr class="border_bottom table_data">
<td>${pQty }</td>
<td>${prodWeight}</td>
<td>${totalWeight}</td>
出力が11 1.0 $ {全重量}
全重量の値が表示さ取得されていないが1.7であります。
私は私が$全重量= $ pQty * $ prodWeight
を使用するときは、この上で私を助ける場合、それはかなりのだろう計算するその計算が正しくなくでき、その後* 1.0 11のように打ち値を置く場合。
おかげで、あなたの参照の
ユーザー(mathTool)[https://velocity.apache.org/tools/1.3/generic/MathTool.html] – soorapadman