Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bib decimal problem : digits truncated

Status
Not open for further replies.

tyris

Programmer
Nov 2, 2000
311
FR
hi,

i have a form where i enter a float that can have more then 15 fraction digits, due to important rates that need so much digits.
i have no problem to display it from a database. the problem is when i take this value from the form.

(example : 0.123456789123456789 returns me 0.1234567891234567 (89 is missing))

i do use this method to get the form value :

myObj.EOLY=request.getParameter("eoly");


i have tested this too :

searchResp.EOLY=request.getParameter("eoly");
BigDecimal bd = new BigDecimal(searchResp.EOLY);
out.println(bd);
(searchResp.EOLY is a String)

the result is the same : the number is truncated after the 16 first digits.
the problem may be when i use getParameter, it converts the number into a String, then if i use BigDecimal, it's too late, the number has already been truncated i think.

i maybe forgot to say that i do have the "eoly" parameter in my jsp and i use getParameter("eoly") in my servlet.


any clues of why it is truncated ?




Best regards X-),
Elise
 
well i think i've found the solution
i think that the problem is with my databse, SQL server, that only takes 17 digits for a float Best regards X-),
Elise
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top