You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Majji, Sashibhushan" <SM...@carreker.com> on 2005/04/13 21:50:49 UTC

ADD Function in Velocity

 Hi All, 

  I am trying to use add functionality with external data 

  #set ( $value = $templet.getLongValue()  ) 
  
  suppose now $value has value of 1 

  #set ( $value = $value + 1  ) 

 Still the total shows 1. Actually its not adding  value . Here
$templet.getLongValue()   returns a long Value 

Thanks 
Sashi 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: ADD Function in Velocity

Posted by Will Glass-Husain <wg...@forio.com>.
In Velocity 1.4 you can not add a long to an integer.

In the unreleased Velocity 1.5-dev you can combine numbers of any data types 
(doubles, ints, longs, BigDecimals, etc).

Download the nightly snapshot from:
http://cvs.apache.org/snapshots/velocity/

WILL

----- Original Message ----- 
From: "Majji, Sashibhushan" <SM...@carreker.com>
To: <ve...@jakarta.apache.org>
Sent: Wednesday, April 13, 2005 12:50 PM
Subject: ADD Function in Velocity


>
> Hi All,
>
>  I am trying to use add functionality with external data
>
>  #set ( $value = $templet.getLongValue()  )
>
>  suppose now $value has value of 1
>
>  #set ( $value = $value + 1  )
>
> Still the total shows 1. Actually its not adding  value . Here
> $templet.getLongValue()   returns a long Value
>
> Thanks
> Sashi
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org