formatNumber « JSTL « JSP-Servlet Q&A





1. Only fraction digits with fmt:formatNumber?    stackoverflow.com

Is it somehow possible to only display the fraction digits with fmt:formatNumber? I basically need to render a price-like double in two fields: decimal and fraction digits (123.456 -> 123 ...

2. using jstl formatNumber with rs.getString    coderanch.com

It should probably also be pointed out that the "formatNumber" tag takes a number (ie Integer, Double etc) and turns it into a String. The value you are passing in is already a String. If what you are getting from the database is a number, I would recommend using the rs.getInt() or rs.getDouble() methods rather than rs.getString().