Board index » delphi » AsCurrency doesn't seem to return floating point numbers

AsCurrency doesn't seem to return floating point numbers

First of all, this is not high priority at all. I have a workaround. Just
passing the word in case this is a bug.

When retrieving a floating point number with a TIBSQL it always gets
converted to an integer value:

Currency balance;
balance = ibsql->FieldByName( "BALANCE" )->AsCurrency;

If I use AsFloat instead, I get the expected result.

balance = ibsql->FieldByName( "BALANCE" )->AsFloat;

Extra info: the ibsql is selecting from a selectable S.P.
Other: when I rightclick IBSQL I don't see ibx version number, when I
rightclick IBDataSet I see ibx version number 4.62
System: BCB5, IBX4.62

Let me know if I need to provide more info,
Martin Lohse

 

Re:AsCurrency doesn't seem to return floating point numbers


Known.  This will be fixed in the next update.  Use AsFloat or AsDouble in the
mean time.

The version number only shows up on the components I already had component
editors written for.  Adding another menu item was simple in those cases than
needing another editor written.  IBSQL just doesn't have a component editor so
doesn't show the item.  IBStoredProc and IBTable don't either IIRC for the same
reason.

Quote
"M. Lohse" wrote:

> First of all, this is not high priority at all. I have a workaround. Just
> passing the word in case this is a bug.

> When retrieving a floating point number with a TIBSQL it always gets
> converted to an integer value:

> Currency balance;
> balance = ibsql->FieldByName( "BALANCE" )->AsCurrency;

> If I use AsFloat instead, I get the expected result.

> balance = ibsql->FieldByName( "BALANCE" )->AsFloat;

> Extra info: the ibsql is selecting from a selectable S.P.
> Other: when I rightclick IBSQL I don't see ibx version number, when I
> rightclick IBDataSet I see ibx version number 4.62
> System: BCB5, IBX4.62

> Let me know if I need to provide more info,
> Martin Lohse

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)

Other Threads