I don't know if it's just me, but
<fmt:formatNumber var="roundedNumber" value="2.5" type="number" pattern="#" />
gives me
<%-- ${roundedNumber} == 2 --%>
Do you know why formatNumber doesn't round this to 3?
UPDATE
It seems that if the number is ODD is rounded correctly, but if it's even number it's not.
2.5 will be rounded 2
2.51 will be rounded 3
3.5 will be rounded 4
3.51 will be rounded 4
4.5 will be rounded 4
4.51 will be rounded 5
... etc
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…