Logic of JSTL fmt tag in displaying decimal numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pinky41
    New Member
    • Apr 2009
    • 3

    Logic of JSTL fmt tag in displaying decimal numbers

    hi ,

    We have the below code in our jsp

    <fmt : formatNumber MaxFraction Digits="1" MinFraction Digits="1" value=$variable >

    if the variable value is 6.650996 it prints 6.7
    if the variable value is 6.652273 it prints 6.7
    if the variable value is 6.65 it prints 6.6

    we actually expect 6.65 also to be printed us 6.7
    It would be very helpful if anyone could explain us the logic of fmt in converting decimal numbers...
Working...