Example uses: $myNumber -> 13.55 $number.format($myNumber) -> 13.6 $number.currency($myNumber) -> $13.55 $number.integer($myNumber) -> 13 Example tools.xml config (if you want to use this with VelocityView): <tools> <toolbox scope="application"> <tool class="org.apache.velocity.tools.generic.MathTool"/> </toolbox> </tools>
This tool is entirely threadsafe, and has no instance members. It may be used in any scope (request, session, or application). As such, the methods are highly interconnected, and overriding key methods provides an easy way to create subclasses that use a non-default format or locale.
@author Nathan Bubna @author Mike Kienenberger @since VelocityTools 1.2 @version $Id: NumberTool.java 545420 2007-06-08 05:21:52Z nbubna $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|