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. Since he left Australia in 2009, he has been living as a digital nomad in over 40 different countries around the world. Roger is addicted to surfing. His other interests are music, psychology, languages, and finding good food.

Leave a Comment

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