Board index » delphi » BDE Returns only 2 Decimals instead of 4

BDE Returns only 2 Decimals instead of 4

I am using Delphi 3.0 with BDE 5.10. This error occurs only on a few
machines. One of
our clients' machines and "luckily" on our tester's machine. Our tester
is running Windows
98 on BDE 5.1.0.

I have ran SQL Monitor on my machine and her machine. I received
different results.
They are as follows:

*** Tester Machine ***

644     02:43:48  SQL Data In: SQL Server - Param = 9, Name = DURATION,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.580000
645     02:43:48  SQL Data In: SQL Server - Param = 10, Name = BILLDUR,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.580000
646     02:43:48  SQL Data In: SQL Server - Param = 11, Name = PAYDUR,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.580000

***  My Machine ***

190     15:08:58  SQL Data In: SQL Server - Param = 9, Name = DURATION,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.583300
191     15:08:58  SQL Data In: SQL Server - Param = 10, Name = BILLDUR,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.583300
192     15:08:58  SQL Data In: SQL Server - Param = 11, Name = PAYDUR,
Type =
fldFLOAT, Precision = 9, Scale = 4, Data = 1.583300

Because the tester's machine is getting 1.580000 instead of 1.583300
(Actual Amount),
the error "cannot edit record because another user changed the record"
comes up when
the BDE does the count(*) from tablename where yadayadayada statement.
It tries to
seee if the record has been changed before I edit it and it thinks it
has becuase of the
rounding difference.

I have found a patch solution to this. I changed the regional setting
value of "No. of Digits
After Decimal" from 2 to 4. This seemed to work. I looked for the
ShortDateFormat
equivalent to the decimals (not the currencydigits) but did not find
one.

This error does not happen on all machines. Maybe 1 out of 150.

Since the regional settings are display options, Is there a reason the
the BDE is using the
regional settings on these computers?

Any response would be greatly appreciated.

Thanks,

Isaac Alexander
VP Software Development
Develus Systems Inc
Certified Delphi Consultant

 

Re:BDE Returns only 2 Decimals instead of 4


Quote
Isaac Alexander wrote in message <3851832E.96043...@deveTHANKSlus.com>...
>fldFLOAT, Precision = 9, Scale = 4, Data = 1.580000
>fldFLOAT, Precision = 9, Scale = 4, Data = 1.583300

Not sure about this, but check the BDE alias properties on both machines and
make sure they're identical.

Quote
>I have found a patch solution to this. I changed the regional setting
>value of "No. of Digits
>After Decimal" from 2 to 4. This seemed to work. I looked for the
>ShortDateFormat
>equivalent to the decimals (not the currencydigits) but did not find
>one.

CurrencyDecimals. These are all grouped together in SysUtils and documented
in the help.

--
Wayne Niddery - WinWright Consulting
RADBooks - http://members.home.net/wniddery/
Toronto Delphi Users Group - http://www.tdug.com/

Re:BDE Returns only 2 Decimals instead of 4


CurrencyDecimals has no effect since this is not currency.  Equally, the
BDE decimals settings is supposed to be for converting strings to
decimals, though, if they differ among machines, it's significant.

John

Other Threads