tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: jstl type conversion
Date Thu, 06 Feb 2003 07:01:37 GMT
On Wed, 5 Feb 2003, Steve Morrison wrote:

> It seems as if the jstl (1.0.2) coerces all numbers to a Double, where
> really what I want is to keep it as an integer.
> 
> <c:set var="height">250</c:set>
> <c:out value="${height/2}"/>
> returns 125.0.  I'd like it to return just 125 - any hints?

Not all numbers are coerced to Double, but the result of a division with
"/" is, by spec.

If you're concerned simply about display, you can use <fmt:formatNumber>
to process the number according to your needs.

-- 
Shawn Bayern
"JSTL in Action"   http://www.manning.com/bayern


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message