velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nat...@esha.com>
Subject Re: operations on numbers from getters
Date Tue, 10 Aug 2004 21:02:50 GMT
Kishore Senji said:
> On Tue, 10 Aug 2004 11:08:17 -0700, Kevin Ward <kevin@kevinandliz.com>
wrote:
> >
> > In the context of a page I have placed an object (granule) which has a
> > method getFileSizeMB() that returns a Double. In that page I am trying the
> > following:
> >
> > #set ( $fileSize = $granule.getFileSizeMB() * 1000000 )
> >
> > and I get an error saying that the right side is null. I can do
> >
> > #set ( $fileSize = $granule.getFileSizeMB() )
> >
> > and that evaluates correctly, so obviously the problem lies in the
> > operation. In the Velocity documentation it mentions that integers (little
> > 'i') are permissible for math functions. Does this mean that the operation
> > is failing because it is a Double?
>
> That's right. Currently only Integer types are supported.
...

but you can easily use the MathTool that comes with VelocityTools to do this.

Nathan Bubna
nathan@esha.com


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


Mime
View raw message