Subject Re: [ib-support] Float data type
Author Martijn Tonies
Hi Stephen,


> I am going to create a new table and I want to include a datatype that is
> similar to a float.

What is the range? Float (or other real-datatypes) have a large range, but
are subject to rounding errors. Numeric or Decimal datatypes have a
smaller range (although quite large since INT64 support) but don't have
any rounding errors as the value is stored in an exact (integer) manner.

> The datatype must be numerical and must have 3 digits before the decimal
> point and a maximum of 6.
>
> e.g.123.456789
>
> Please note that the 3 digits before the decimal point are a must, even
when
> they are 0. e.g. 004.232 but the digits after the decimal point, and the
> decimal point itself, are optional.

I think the leadings zeros is only a display thingy and should be handled by
the client side. If this is not the case (that is, you want it to be stored
exactly
that way) than you're mixing representation and physical storage. The only
option, I think, in that case is to store strings (varchar) and add the
leading
zeros before storing. If you want to perform calculations on the column, you
do have to convert to numerics while calculating.



Hope this helps,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."