velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Help with format currency
Date Wed, 14 Nov 2007 20:43:45 GMT
On Nov 14, 2007 12:35 PM, JoseBovet <jose.bovet@gmail.com> wrote:
>
> Hi, I need form a curreny value
>
> I' can't use
> the numer to format is 1000 to $1.000
>
> $number.format('currency',$myNumber)

a few responses:
- it is helpful to tell what happens when you try it, rather than just
ask how to do something.
- your template code above can be shortened to $number.currency($myNumber)
- the problem is that the NumberTool does formatting on numbers, not
unit conversions.  it looks like you want to go from tenths of a penny
to dollars.  try this:   $number.currency($myNumber / 1000)
- if you want to know more about the formats supported by NumberTool,
be sure to read the docs for it and especially read this:
http://java.sun.com/javase/6/docs/api/java/text/NumberFormat.html


> --
> View this message in context: http://www.nabble.com/Help-with-format-currency-tf4807794.html#a13755799
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message