How to get int type data from 6/4 in expression language

As the topic depicts, I want an integer from 6/4, but the result is 1.5(always results in double type), is there any way to get an int or change the double type into an integer,in EL?Thanks in advance.
[215 byte] By [MickyLianga] at [2007-11-27 1:32:52]
# 1
What would you like to get for 6/4 ?1 ? 2 ?If you assign the value to an int, it will be an int.If you assign the value to a BigDecimal, it will be that.What's the problem you have got ?
rym82a at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I want to get 1, how can I do that?Thank you.
MickyLianga at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
My problem is, I want to get an integer(2) from 6/3, but the result is 2.0.As I know, there are no data types in EL language, so how can I get an integer(2) from that-without scriptlet in jsp page?
MickyLianga at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
int a = 6/4;System.out.println(a); // 1You get 1.5 ?
rym82a at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Yes, the way you did can generate 1.But I don't want to use scriptlet, my code is like this:<%@ taglib .....%>6/3=<c:out value="${6/3}"/>6/4=<c:out value="${6/4}"/>The result is 2.0 and 1.5.How can I get the integers without scriptlet?
MickyLianga at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

I think you should check fmt.formatNumber or fmt:parseNumber

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL6.html#wp86733

http://www.java2s.com/Code/Java/JSTL/JSTLformatnumber.htm

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/formatNumber.html

http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fmt/parseNumber.html

Message was edited by:

rym82

rym82a at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
thx a lot. ^_^
MickyLianga at 2007-7-12 0:37:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...