Why float columns are always rounded off to 2 digits after the floating point

Database

Why float columns are always rounded off to 2 digits after the floating point

Hi,

 

Whenever we use a define a Float column in Teradata and insert data into the column the data is always rounded off to 2 digits after the floating point.

For example I have a column in the table as col1(Float).I insert  following values into the column:

3343.398883434
356543.391118883434

But when I query the data it comes as:

3,343.40

356,543.39

respectively.Is this behaviour related to SQL assistant client settings or there is a separate reason for this?

 

Regards,

Indranil Roy

 

 

1 REPLY
N/A

Re: Why float columns are always rounded off to 2 digits after the floating point

It's not rounded when you insert the row, it's just a default display format in SQL Assistant:

Options -> Data Format -> Number of decimal places to display for Float columns

 

You can try CAST(floatcol AS NUMBER) to display all significant digits.