XML Dump random problem with VDouble

Stan Busk maxprog at mac.com
Thu Mar 22 04:14:36 CDT 2007


On Mar 22, 2007, at 8:02 AM, Ruslan Zasukhin wrote:

> On 21/3/07 10:20 PM, "Stan Busk" <maxprog at mac.com> wrote:
>
> Hi Stan,
>
>> I have a problem with XML Dump. I never exactly get back what I dump.
>> As an example my DB as a record, #1341, where a VDouble is storing
>> the value '10149.25'. The XML dump always creates that record with a
>> value of '10149.20'. It doesn't happen on all records, only 1% or 2%
>> records. Also I can't see any reason or pattern. The number has
>> nothing particular, other similar numbers are dumped correctly.
>>
>> This is how the record looks like in the app:
>> http://www.maxprog.com/misc/valentina/record.jpg
>> The on-list data and edition data are made thru 2 different queries.
>> All the app (reports, stats, etc...) show that record with  
>> '10149.25'.
>
> You use DOUBLE value to keep money value?
>
> This is not a good idea. DOUBLE is not infinite sequence in the  
> computer
> CPU.
>
> Better use STRING
> or I have hear people use 2 INT fields:
>
>         194.25  =>  194 and 25

I have never had problems using doubles to store money values so far.  
Furthermore my amounts have a finite number of decimals. Anyway, I  
can store results of operations, search amounts...etc... the only  
problem I have is when comparing actually because I have to use a  
difference between what I look for and what I get and depending on  
the currency I use a different precision 0.01, 0.001, 0.0001... But  
this is another story. Perhaps using a string would have been better  
but we are talking of an app I created 5 years ago when I had no idea  
of databases. I though it was the best choice as I use amounts as  
doubles inside the whole app.

>> This is an extract of the XML dump for that record:
>>
>> <Record>
>>     <f n="RecID">1341</f>
>>     <f n="Transaction_Date">10/25/2004</f>
>>     <f n="Transaction_Type">7</f>
>>     <f n="Transaction_AccountDebited">17</f>
>>     <f n="Transaction_AccountCredited">1</f>
>>     <f n="Transaction_Amount">10149.2</f>
>>     <f n="Transaction_Comment"><![CDATA[]]></f>
>>     <f n="Transaction_InvoiceNum"><![CDATA[]]></f>
>> </Record>
>>
>> The amount is converted to '10149.2'. I found a dozen of such errors
>> out of 2500 records.
>>
>> I would say it is a bug. I can create a report at mantis. What do you
>> need?
>
> I think first of all this can be checked in Valentina Studio with  
> one table
> and one field and one this value 10149.25.  If this reproduce then  
> enough.

Let me know if you want the database originating the problem.

>
>
> -- 
> 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



More information about the Valentina mailing list