velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tal Dayan" <...@zapta.com>
Subject RE: Formating data with Velocity
Date Sat, 14 Jul 2001 16:30:53 GMT
You may try

getCurrencyInstance() of 

http://java.sun.com/products/jdk/1.2/docs/api/java/text/NumberFormat.html

and 

http://java.sun.com/products/jdk/1.2/docs/api/java/text/DecimalFormat.html

but you will need to write a think interface and attache it to the template
context.

Tal

> -----Original Message-----
> From: gmj@mta8.srv.hcvlny.cv.net [mailto:gmj@mta8.srv.hcvlny.cv.net]On
> Behalf Of Geir Magnusson Jr.
> Sent: Saturday, July 14, 2001 7:22 AM
> To: velocity-user@jakarta.apache.org
> Subject: Re: Formating data with Velocity
> 
> 
> One Way wrote:
> > 
> > Is there a way to format the data in Velocity, e.g. 123456.78 needs to
> > be shown as 123,456.78 or $123,456.78 in a web page.
> > 
> 
> Nothing in Velocity proper.  This would be the domain of what we call a
> 'context tool', a class put into the context for use by the template
> designer, such as 
> 
> $formatTool.currency( "123456.76")
> 
> There must be a library floating around somewhere to do this...
> 
> geir
> 
> -- 
> Geir Magnusson Jr.                           geirm@optonline.net
> System and Software Consulting
> Developing for the web?  See http://jakarta.apache.org/velocity/
> You have a genius for suggesting things I've come a cropper with!
> 

Mime
View raw message