Velocity only supports int. It does not do number type conversions.
There was just a long thread of discussion about a similar topic
(supporting floating point numbers). It seemed most the developers of
Velocity are of the opinion that even supporting any numeric data was a
mistake they wish had been avoided, it was only in place to make
converting from WebMacro easier, and they are loathe to add any further
ability to use number literals in templates.
john mcnally
William Lee wrote:
>
> I'm wondering if it's possible to do the following:
>
> Define a class and function like:
>
> class Foo
> {
> public Object bar(String str, long n1, long n2);
> }
>
> In the velocity context I put an instance of Foo (say $foo). I then
> have in my velocity macro:
>
> #set ($a = 3)
> #set ($b = 4)
> #set ($result = $foo.bar("blah", $a, $b))
>
> I've tried to do something like the aboved but somehow the bar function
> is never called. The velocity log says the RHS of the last set
> statement is null. I'm just wondering how type casting work in
> Velocity. Is it actually possible to do the aboved? Is there any way
> to get around this?
>
> Thanks,
> --
> William Lee (Will) | Sendmail Inc.
> Email: [EMAIL PROTECTED] | http://www.sendmail.com
> Tel: (510) 594-5505 |
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]