0

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

skaffman
  • 398,947
  • 96
  • 818
  • 769
mike
  • 2,722
  • 6
  • 31
  • 46

2 Answers2

0

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

Waleed A.K.
  • 1,596
  • 13
  • 13
0

I figured it out:

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

:)

mike
  • 2,722
  • 6
  • 31
  • 46