0
我想在速度中添加两个值,它总是返回0.我做错了什么?为什么在nVelocity中添加两个值总是返回零?
#set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount)
两个$ orderItem.ExtendedPrice & $ discountAmount与小数整数,像这样:99.99
我想在速度中添加两个值,它总是返回0.我做错了什么?为什么在nVelocity中添加两个值总是返回零?
#set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount)
两个$ orderItem.ExtendedPrice & $ discountAmount与小数整数,像这样:99.99
我想通了:
#set ($tmpPrice = $orderItem.ExtendedPrice.ToDecimal(null) + $discountAmount.ToDecimal(null))
:)
尝试$tmpPrice = ($orderItem.ExtendedPrice + $discountAmount)