| Author |
Float precision problem?
|
mallikarjun dontamsetti
Ranch Hand
Joined: Mar 18, 2011
Posts: 233
|
|
I am displaying emp table(oracle) data in jsp the salary column has to display up-to two precision values like 1000.50 or 10000.00
but it is showing like 10000.0 only is there any way to get the data up-to required precision.
Note:I am taking sal column as float in my bean.
|
 |
Rajkamal Pillai
Ranch Hand
Joined: Mar 02, 2005
Posts: 434
|
|
For as similar requirement I used an different getter from the Bean (Value/Form) which would return a String value, currency formatted from the value stored in the respective data member.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
How is your number defined in Oracle? Assuming it allows for at least two decimal points then you can format this how ever you like using the JSTL format tag.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
mallikarjun dontamsetti
Ranch Hand
Joined: Mar 18, 2011
Posts: 233
|
|
|
Number(8,2)
|
 |
Mike Zal
Ranch Hand
Joined: May 04, 2011
Posts: 144
|
|
|
JSTL FMT number example
|
OCJP6, OCWCD5
|
 |
 |
|
|
subject: Float precision problem?
|
|
|