velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: comparing monetary value
Date Thu, 17 Oct 2002 00:39:12 GMT

I admit that I have not read every post on this issue, and
also that formating money is not near and dear to my heart,

Perhapse the way to make everyone happy at once is to have a 
standard java tool for formatting numbers (or maybe formatting 
in general) included in the Velocity distribution.  That way, none of
the formatting syntax needs to pollute the template language
(like it does in FreeMarker).  Also, if someone doesn't need
it, they don't have to use it, or even include it in their
Jar file.  Also, if someone wants a better/different one, they 
can replace it.  On the other hand, the standard one can be
documented and integrated and tested, so it will be easy to

I also think this divides the work properly:
The java programmer worries about data representation issues.
The template writer worries about where and how stuff should be

Something like this:
$,"0.00") -> 2.67
or maybe the C way:
$, "%.2f") -> 2.67
or something higher level:
$, "money") -> 2.67

The exact formatting commands matter less than the fact that it
is standardized, documented, tested, etc.

Joshua Levy

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message