On 3/5/07, Dennis Birch <[EMAIL PROTECTED]> wrote:
> I decided to give the Currency field type in REALSQLDatabase a try,
> and I'm having problems assigning any values to records in my
> application.
>
>
> I changed a number of fields in different tables from using Doubles to
> using Currency. So a line to add a field as part of a new record
> changed from:
>
> rec.DoubleColumn("Charges") = entry.Charges
>
> to:
>
> rec.CurrencyColumn("Charges") = entry.Charges
>
> And I added a bunch of records with these changes to use Currency
> instead of Double fields.
>
> Now when I access any of these fields' CurrencyValue I get 0.
>
> What's going wrong here?
After a few hours of struggling with this, I have finally figured out
what happened to the numbers I entered as currency. The decimal point
is being moved four places to the left. And now I even see where that
behavior is actually documented. As far as I have been able to see, it
does not appear in the online Language Reference, or the PDF version.
They both describe the Currency type as: "A 64-bit fixed-point number
format that holds 15 digits to the left of the decimal point and 4
digits to the right." But the User's Guide PDF has an expanded
explanation of the Currency data type which states that: "It is scaled
by 10,000 to give 4 digits to the right of the decimal point."
Sure wish I'd seen that before I wasted all this time futzing around on my own!
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>