On 5/5/06, Julian Ray <[EMAIL PROTECTED]> wrote:
How about creating a CurrencyConverter which would have configurable and
localizable currency formats as well as style for positive and negative
values etc. Is there any value in this?

If we could drum up a list of requirements I would be willing to get it
started as I have to build one anyway in the very near future.

Hey Julian,

I think f:convertNumber can do all of this already.

http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/f/convertNumber.html

The only problem with it is that it returns a Number (internally
either a Long or Double - depending on the input), which means your
backing beans must represent currency via Number getters and setters.

I'm thinking that subclassing NumberConverter and coercing the type is
probably all that's necessary.   But since I'm using Facelets, I don't
have a lot of interest in creating jsp tags and tlds and all that JSP
support unless there's actual interest beyond my own personal use.

Mario's idea of supporting configurable return types sounds good if
this is going to become a public component.

Reply via email to