This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Hi, in a jsp i am displaying some numeric bean properties (all of them are strings) and i would like to know how could i apply a format to them. The problem is that <bean:write name="bean" property="p" format="###.##"/> does not work because it is a string so it doesn�t get formatted, any ideas? Thanks.
You're working too hard. The format attribute should contain a simple String indicating how to format the number. Change your code to:
Just make sure that the bytes property contains a number (float, double, etc.) rather than a String or other data type. If it doesn't, convert it to a numeric data type in the getter as I demonstrated in a previous post.