You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2003/07/14 17:34:02 UTC

Re: Displaying a formatted double

Greg Nudelman said:
> I have a static formatDouble method that outputs what I want, but I can't
> seem to be able to call:
>
> $MyObj.formatDouble($myObj.doubleAttr())


Static methods can't be called from the Velocity context.  Make it a
non-static method of a singleton instance, and it will work fine.

WILL

_______________________________________
Forio Business Simulations
Will Glass-Husain

wglass@forio.com
www.forio.com


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


Re: Displaying a formatted double

Posted by Nathan Bubna <na...@esha.com>.
Will Glass-Husain said:
> Static methods can't be called from the Velocity context.

not true.  you can call *any* public method on an instance of any public
class.  whether it's static or not doesn't matter.  (otherwise, things like
velocity-tools' MathTool wouldn't work, and i assure you that it does. :)

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