main logo
Subject: Re: SQL Query/Method fields
Author: Frank Bitterlich
Posted: 2001/08/30 12:47:37
 
View Entire Thread
New Search


(Attention: long post)

Ruslan,

maybe it was discussed on the list; but that was before I read it. And
while I do consider this list very valuable and helpful, it is NOT a
replacement for documentation.

As for floating-point arithmethics: In both RB itself (don't know about
the RB DB, I mean the native "Double" type) and in "number" fields in
FileMaker (which are floating-point numbers), there is NO problem
storing monetary values. But maybe I'm misunderstanding the whole
problem (hopefully).

In FMP, if you put a number with two or less decimal digits into a
field, you get exactly that number back. Always.

In RB, if I put a two-decimal number into a Double and retrieve the
result back with Format(), I always get the correct value back. IOW, the term

Format(CDbl(myString), "#") = myString

is always true.

Sure, looking at the Double value in the debugger might show a strange
result - but who cares about that? That's only important if you're doing
math with it, and then you simply need to do the appropriate Round() function.

If the problem in V4RB is the same - only relevant in Method fields
where calculations are done with it - then I'm relieved. Then I don't care.

But if I write
myVFloatField.SetString("123.45")
s = myVFloatField.GetString

and s is "123.46", then I don't find that funny. (Although
"123.45000002563" would be perfectly acceptable, since that's the normal
floating-point arithmethic problem).

Please tell me that I've misunderstood the whole problem, you'd make me
very happy with that ;-)

Cheers,
Frank+++



Ruslan Zasukhin wrote:
>
> on 8/30/01 19:03, Frank Bitterlich at bitterlich .AT. gsco .D.OT de wrote:
>
> > Also what did make a negative impression on me was the fact that it was
> > mentioned on the list today that you cannot store monetary values
> > reliably in VFloat, VDouble, ... fields. I'm VERY unhappy about the fact
> > that this wasn't mentioned in the docs. The result for me is that I can
> > trash my whole database design and redesign a whole lot of code in a
> > huge application. This is not nice.
>
> Frank, but problem is not because Valentina IS NOT able handle money in
> FLOAT type.
>
> THIS IS problem of computers itself, so why I should mention this in the
> docs ???
>
> EACH DBMS has this "problem" so far: mySQL, FileMaker, SQL Server.
>
> And we have discuss this several times on Valentina list.
> So this is not my fault that you have choose wrong way for money storage.
>
> --
> Best regards,
> Ruslan Zasukhin

--
Günter Schmidt & Co. oHG
Frank Bitterlich eMail: bitterlich@gsco.de
Schlosserstr. 2-4 WWW: http://www.gsco.de/gsco
D-60322 Frankfurt Tel.: 069 / 156809-29
GERMANY Fax: 069 / 156809-28
 
©2001 Frank Bitterlich
<-- Prior Message New Search Next Message -->