Page 1 of 1

Email template nvelocity variable

Posted: Thu Feb 11, 2010 4:48 pm
by michael.p.larsen
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?

Re: Email template nvelocity variable

Posted: Thu Feb 11, 2010 5:15 pm
by michael.p.larsen
Got it.
Have to use .ToDecimal

#set ($shipTotal = $shipTotal.ToDecimal(null) + ($orderItem.Price.ToDecimal(null) * $orderItem.Quantity))

Re: Email template nvelocity variable

Posted: Tue Aug 10, 2010 7:07 am
by ozlighting
Thanks for posting the solution, you helped me out!

Cheers,

Lance