I'm trying to sum line items amounts, but for some reason the decimal isn't getting included.
I'm doing:
#set ($shipTotal = 0)
...
#set ($shipTotal = $shipTotal + $orderItem.Price)
Say the Price is 100.25... the $shipTotal would only show 100.
What am I doing wrong?
Email template nvelocity variable
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
-
- Lieutenant (LT)
- Posts: 70
- Joined: Fri Jan 15, 2010 8:17 am
Re: Email template nvelocity variable
Got it.
Have to use .ToDecimal
#set ($shipTotal = $shipTotal.ToDecimal(null) + ($orderItem.Price.ToDecimal(null) * $orderItem.Quantity))
Have to use .ToDecimal
#set ($shipTotal = $shipTotal.ToDecimal(null) + ($orderItem.Price.ToDecimal(null) * $orderItem.Quantity))
-
- Lieutenant (LT)
- Posts: 53
- Joined: Tue Mar 24, 2009 9:49 pm
- Contact:
Re: Email template nvelocity variable
Thanks for posting the solution, you helped me out!
Cheers,
Lance
Cheers,
Lance