1

I have one variable which is BigDecimal abc and i have store in database with column_name is ( abc decimal(30,20) ) using Hibernate. so when i save data with abc variable and value = 00.0000000000 it will store in database perfectly, but when i get from database using Hibernate it will store as 0E-10 in BigDecimal abc but i need exact store value in database.

if any one have solution for above problem ??

i have already try to seach in google and also in stackoverflow.

Sagar
  • 35
  • 5

1 Answers1

1

As explained here, Double Multiplication can get the unexpected result. You will have to store it as string and when you retrieve it, you made the conversion and it will conserve the right value.

Jonathan Gagne
  • 4,241
  • 5
  • 18
  • 30