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
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