Percentages with JSF NumberConverter

By , 3 July 2009

Percentages with JSF NumberConverter

Hooray for buggy javadocs. The JSF taglib describes the type attribute of an f:numberConverter as:

Specifies how the number string will be formatted and parsed. Valid values are "number", "currency", and "percentage".

Nice, but wrong. For percentages, the correct value is percent, as defined in the JSF spec.

<f:convertNumber type="percent"/>

Where do I apply for my refund on that hour of my life?

Percentages with JSF NumberConverter

About Roger Keays

Percentages with JSF NumberConverter

Roger Keays is an artist, an engineer, and a student of life. He has no fixed address and has left footprints on 40-something different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, the proper use of semicolons, and finding good food.

Leave a Comment

Please visit https://rogerkeays.com/blog/percentages-with-jsf-numberconverter to add your comments.