Another potential way to do it is to use the <fmt:formatNumber> tag
It is almost equivalent to Math.round, but not quite. Math.round method always rounds a .5 up to the nearest whole number.
The number formatter uses the ROUND_EVEN approach, meaning if it is rounding .5, it will round to the nearest EVEN number (may be up or down)
One thing that bugs me looking at this code, is that you are putting a rounded result into an input field.
I'm of the opinion that if the value for that field is meant to be an integer, then Obj.Value should be an integer.
If this page is used for an edit screen, the value can change without user intervention because of your rounding here.
However you don't have a name attribute on this input field, so I guess you're not using it for submitting the page. Why then are you using <input type="text">??
Joined: Nov 09, 2010
For your suggestions,from next time i will follow the Conventions.I will try those 2 scenarios.