You are not logged in.
I want convert BigDecimal to Float.
I do this :
For BigDecimal = "123456.12000000000" the result is good, I obtain the float value 123456.12
For BigDecimal = "1234567.12000000000" the result is not good, I obtain the float value 1234567.1 instead off 1234567.12
For BigDecimal = "123456789.12000000000" the result is not good, I obtain the float value 1.23456792E8 instead off 123456789.12
What I must do to resolve this problem ?
Thank for help
when you convert BigDecimal to Float or Double you lose precision. BigDecimal is the only way to be sure to keep all decimal number.
try to put precision to 2 (after dot) with double type.
result with "1234567.12000000000"
Starting job bigd at 15:45 27/08/2013. [statistics] connecting to socket on port 4009 [statistics] connected 1234567.12 [statistics] disconnected Job bigd ended at 15:45 27/08/2013. [exit code=0]