velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: calling setProperty(float) not possible ?
Date Thu, 12 Jul 2001 01:44:32 GMT
Andrea Papotti wrote:
> 
> > I have an object called "person" with method "setIncome(float income)"
> > accessible within the template:
> > ...
> > $person.setIncome(5000)
> > ...
> >
> > while merging the template Vel don't calls setIncome, because the 5000 is
> > interpreted as an int and a method with that signature doesnt exist.
> 
> have you tryed with
> 
> $person.setIncome(5000.00)
> 
> it seems to make sense
> 
> bye, Andrea Papotti

No - to iterate on what Jon said, velocity does not support floating
point numbers in VTL.  Only integers - therefore, it won't identify the
sequence of characters 5000.00 as a floating point number, but will
throw a parsing exception.

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Mime
View raw message