1

I'm somewhat confused on defining the correct definition for a float table column. This is required to create a database table to store large numbers which have up to eight decimal places. I need to be able to store anywhere from and between the following two.

0.00000001 - 10000000

Would that be defined as float(16) as the argument is the maximum number of digits that need to be displayed. Perhaps I have misunderstood the column definition entirely.

0

1 Answer 1

1

FLOAT is approximate datatype and I would not recommend it to use for storing exact values.

For storing exact numbers you should use DECIMAL datatype:

CREATE TABLE tab(col DECIMAL(20,10)); 

Should be more than sufficent for your needs.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.