Subject | Re: [ib-support] Float data type |
---|---|
Author | Martijn Tonies |
Post date | 2002-06-21T15:03:59Z |
Hi Stephen,
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 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."
> I am going to create a new table and I want to include a datatype that isWhat is the range? Float (or other real-datatypes) have a large range, but
> similar to a float.
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 decimalwhen
> point and a maximum of 6.
>
> e.g.123.456789
>
> Please note that the 3 digits before the decimal point are a must, even
> they are 0. e.g. 004.232 but the digits after the decimal point, and theI think the leadings zeros is only a display thingy and should be handled by
> decimal point itself, are optional.
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."