NumberTool - Documentation topics on: numbertool,.

This documentation is a static copy for this version. For current documentation, see:

Class NumberTool


public class NumberTool
extends java.lang.Object

Tool for working with Number in Velocity templates. It is useful for accessing and formatting arbitrary Number objects. Also the tool can be used to retrieve NumberFormat instances or make conversions to and from various number types.


 Example uses:
$myNumber -> 13.55
$number.format('currency',$myNumber) -> $13.55
$number.format('integer',$myNumber) -> 13

Example toolbox.xml config (if you want to use this with VelocityView):

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.

VelocityTools 1.2
$Id: 71982 2004-02-18 20:11:07Z nbubna $
Nathan Bubna, Mike Kienenberger

For complete documentation on this viewtool use the following link: NumberTool