-1

I have a float type column in my database table . When i parse the 10 digit value as float from front end and store in the table. It gets stored in E raise to power form

Whereas if i manually enter a 10 digit value in SQL database nothing like that happens

What should i do?

The data is also getting rounded off for example i an entering 5666666666

and this is what happens

enter image description here

vini
  • 4,657
  • 24
  • 82
  • 170

3 Answers3

3

better use DECIMAL(12,2) for this kind of field.

John Woo
  • 258,903
  • 69
  • 498
  • 492
  • Its not possible to change the database type as this a clients database isnt there any other work around?... – vini Nov 13 '12 at 08:21
0

It seems your front end only accepts 7 digits in the mantissa and the database accepts 15. You might achieve what you want by increasing precision in the front end data type.

That being said, please try to get your client to use an exact (decimal) type for this column instead.

digscoop
  • 371
  • 1
  • 6
0

Check front end app weather it does rounds up floater and tell your client to use money for a data type. Alternative to float use numeric or decimal with precision (you will make shure it is a precision u want to keep). Due to floater is a number calculated with a base of 2, you can have a gaps like one you presented in saving data. That why u NEVER use float for money data.

Gustav Klimt
  • 430
  • 3
  • 14