float column -- Ivan ?

Ivan Smahin ivan_smahin at paradigmasoft.com
Fri Apr 20 08:45:04 CDT 2012


On Apr 19, 2012, at 11:48 PM, George Parkinson wrote:

> hi ruslan,
> i find virtually nothing on scale/precision in wiki...
> and even less in vstudio.
> exactly where can i find these settings?
> thanks,
> george
> 
> 
> 
> From: Ruslan Zasukhin <ruslan_zasukhin at valentina-db.com>
> To: "valentina at lists.macserve.net" <valentina at lists.macserve.net> 
> Sent: Thursday, April 19, 2012 2:23:56 PM
> Subject: Re: float column -- Ivan ?
> 
> On 4/19/12 8:52 PM, "George Parkinson" <george at microtherapy.ca> wrote:
> 
> Hi George,
> 
> > hello all,
> > i have a float column (f) in table t.
> > some values do not read back as inserted.
> > 
> > for example:
> > INSERT INTO t (f) values (341.1) -->>  reads back as 341.10001
> > INSERT INTO t (f) values (341.2) -->> reads back as 341.20001
> > INSERT INTO t (f) values (341.3) -->> reads back as 341.29999
> > INSERT INTO t (f) values (341.4) -->> reads back as 341.39999
> > INSERT INTO t (f) values (341.5) -->> reads back as 341.50000
> > INSERT INTO t (f) values (341.6) -->> reads back as 341.60001
> > INSERT INTO t (f) values (341.7) -->> reads back as 341.70001
> > INSERT INTO t (f) values (341.8) -->> reads back as 341.79999
> > INSERT INTO t (f) values (341.9) -->> reads back as 341.89999
> > INSERT INTO t (f) values (341.10) -->> reads back as 341.10001
> > 
> > the question is: is this normal?
> 
> FLOAT/DOUBLE columns have additional parameter decision/scale
> 
> Check it ...easiest way using Valentina Studio and your db.
> 
> 
> -- 
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 
> 


Yes, should be more info. In short, both params defines how float/double should be converted into the string result whenever it needed.

Defaults are:
(15,6) for double
(6,5) for float

For example:

SELECT 'Float value:' | fld_float FROM t1
--
'Float value:     1.12345' -- for 1.12345


BTW, it could be better use Format() sql-function
http://www.valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_string&s%5B%5D=format#format


-- 
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120420/e8adbf3a/attachment.html>


More information about the Valentina mailing list