tags:

views:

18

answers:

2

I'm trying to add two values in velocity and it always returns 0. What am I doing wrong?

#set ($tmpPrice = $orderItem.ExtendedPrice + $discountAmount)

Both $orderItem.ExtendedPrice & $discountAmount are whole numbers with decimals, like this: 99.99

A: 

try $tmpPrice = ($orderItem.ExtendedPrice + $discountAmount)

Waleed A.K.
A: 

I figured it out:

#set ($tmpPrice = $orderItem.ExtendedPrice.ToDecimal(null) + $discountAmount.ToDecimal(null))     

:)

mike