On Fri, Mar 9, 2012 at 06:36, Jonas Maebe wrote:
> On 09 Mar 2012, at 10:23, Sven Barth wrote:
>
>> The buzzword for this is Fixed Point Arithmetic. See
>> here: http://en.wikipedia.org/wiki/Fixed-point_arithmetic
>
> And in principle, it's exactly what currency should use. And in fact, it is
> wh
On 09 Mar 2012, at 10:23, Sven Barth wrote:
The buzzword for this is Fixed Point Arithmetic. See here:
http://en.wikipedia.org/wiki/Fixed-point_arithmetic
And in principle, it's exactly what currency should use. And in fact,
it is what it does use in FPC on platforms that don't support an
Am 08.03.2012 13:14, schrieb Marcos Douglas:
So, if you have two values to storage (amount of decimals is 4) e.g.
100.34524 and 2,000.2 you do:
100.34524 = 1003452
2,000.2 = 20002000
I never heard about this technique before. Very good!
The buzzword for this is Fixed Point Arithmetic. See here
On 8 March 2012 14:14, Marcos Douglas wrote:
>
> So, if you have two values to storage (amount of decimals is 4) e.g.
> 100.34524 and 2,000.2 you do:
> 100.34524 = 1003452
> 2,000.2 = 20002000
Correct.
We then implemented our own function [eg: M2AmountToCurr() ] which
formats such a number [only
On Thu, Mar 8, 2012 at 4:41 AM, Graeme Geldenhuys
wrote:
> On 8 March 2012 03:28, Marcos Douglas wrote:
>>
>> Integer math... what did you mean?
>
> Over the years we have experience many problems with currency,
> floating point and date/time calculations and storage. So we tweaked
> our software
On Thu, Mar 8, 2012 at 3:28 AM, Marcos Douglas wrote:
> Integer math... what did you mean?
Integer math = Currency or in DB numeric(18, 4)
in Firebird
create domain AMOUNT as numeric(18,4);
On Thu, Mar 8, 2012 at 12:43 AM, Graeme Geldenhuys
wrote:
> This is why our accounting app uses Inte
On 8 March 2012 03:28, Marcos Douglas wrote:
>
> Integer math... what did you mean?
Over the years we have experience many problems with currency,
floating point and date/time calculations and storage. So we tweaked
our software to handle such data slightly different.
If a user enters and amount
On Wed, Mar 7, 2012 at 7:43 PM, Graeme Geldenhuys
wrote:
>
>
> On Wednesday, 7 March 2012, Zaher Dirkey wrote:
>>
>> In accounting/financial systems there is Debit and Credit numbers it must
>> equal and Debit - Credit = 0, with this bug it fail.
>> I am an accountant and i know if there is 0.000
On Wednesday, 7 March 2012, Zaher Dirkey wrote:
>
> In accounting/financial systems there is Debit and Credit numbers it must
equal and Debit - Credit = 0, with this bug it fail.
> I am an accountant and i know if there is 0.0001 diff in balance sheet,
my boss will fire me :P
This is why our acco
2012/3/6 Flávio Etrusco
> I'm glad I never worked with banking/financial systems
> :-$
>
In accounting/financial systems there is Debit and Credit numbers it must
equal and Debit - Credit = 0, with this bug it fail.
I am an accountant and i know if there is 0.0001 diff in balance sheet, my
boss
On Tuesday, 6. March 2012 14.13:17 Ludo Brands wrote:
> >
> > No, Currency is based on Extended on i386 and x86_64 (except win64!).
> >
>
> There is also a lot of code in the rtl and fcl-db that supposes currency =
> double. Fe.
>
> Function CurrToStr(Value: Currency; Const FormatSettings: TFormatS
On Tue, Mar 6, 2012 at 12:11 PM, Jonas Maebe wrote:
>
> On 06 Mar 2012, at 13:28, michael.vancann...@wisa.be wrote:
>
>> As far as I know, Currency is always a scaled int64, and didn't interpret
>> the
>> request as a request to change that.
>
>
> The problem is that on i386 (and in Delphi on i386
On 06 Mar 2012, at 13:28, michael.vancann...@wisa.be wrote:
As far as I know, Currency is always a scaled int64, and didn't
interpret the
request as a request to change that.
The problem is that on i386 (and in Delphi on i386), operations on the
currency type are handled using the fpu. Th
On 06 Mar 2012, at 14:13, Ludo Brands wrote:
There is also a lot of code in the rtl and fcl-db that supposes
currency =
double. Fe.
Function CurrToStr(Value: Currency; Const FormatSettings:
TFormatSettings):
string;
begin
Result:=FloatToStrF(Value,ffGeneral,-1,0,FormatSettings);
end;
F
> > There is also a lot of code in the rtl and fcl-db that supposes
> > currency = double. Fe.
> >
> > Function CurrToStr(Value: Currency; Const FormatSettings:
> > TFormatSettings): string; begin
> >Result:=FloatToStrF(Value,ffGeneral,-1,0,FormatSettings);
> > end;
> >
> > Or
> >
> > TCurre
Am 06.03.2012 14:13, schrieb Ludo Brands:
Note that this requires compiler patching, because abs()
is internal
(it can be used in constant expressions). I would
personally argue to
do away entirely with the "treat currency as a floating
point type on
i386 so it can use the 80x87", and inste
On Tue, Mar 6, 2012 at 2:56 PM, Sven Barth wrote:
> No, Currency is based on Extended on i386 and x86_64 (except win64!).
Hmm, but it is break the balance in the budget of my customer.
I resolved it by adding CurrABS function, but i don't think it is good idea.
Best Regards
Zaher Dirkey
__
> >> Note that this requires compiler patching, because abs()
> is internal
> >> (it can be used in constant expressions). I would
> personally argue to
> >> do away entirely with the "treat currency as a floating
> point type on
> >> i386 so it can use the 80x87", and instead map it
> imple
Am 06.03.2012 13:28, schrieb michael.vancann...@wisa.be:
On Tue, 6 Mar 2012, Jonas Maebe wrote:
On 06 Mar 2012, at 13:05, michael.vancann...@wisa.be wrote:
On Tue, 6 Mar 2012, Zaher Dirkey wrote:
On Mon, Mar 5, 2012 at 12:22 AM, Jonas Maebe
wrote:
This particular problem could obviousl
On Tue, 6 Mar 2012, Jonas Maebe wrote:
On 06 Mar 2012, at 13:05, michael.vancann...@wisa.be wrote:
On Tue, 6 Mar 2012, Zaher Dirkey wrote:
On Mon, Mar 5, 2012 at 12:22 AM, Jonas Maebe
wrote:
This particular problem could obviously be resolved by adding a
currency-specific version of ab
On 06 Mar 2012, at 13:05, michael.vancann...@wisa.be wrote:
On Tue, 6 Mar 2012, Zaher Dirkey wrote:
On Mon, Mar 5, 2012 at 12:22 AM, Jonas Maebe >wrote:
This particular problem could obviously be resolved by adding a
currency-specific version of abs()
Can i ask to add overload function fo
On Tue, 6 Mar 2012, Zaher Dirkey wrote:
On Mon, Mar 5, 2012 at 12:22 AM, Jonas Maebe wrote:
This particular problem could obviously be resolved by adding a
currency-specific version of abs()
Can i ask to add overload function for ABS(Currency) be a feature request
in FPC?
Yes, please ad
On Mon, Mar 5, 2012 at 12:22 AM, Jonas Maebe wrote:
> This particular problem could obviously be resolved by adding a
> currency-specific version of abs()
Can i ask to add overload function for ABS(Currency) be a feature request
in FPC?
Thanks
I am using last reversion of Lazarus, FPC 2.6
Bes
On 04 Mar 2012, at 22:31, Zaher Dirkey wrote:
> I found this problem in Delphi and FPC, please test it and confirm if it is
> a bug.
The problem is caused by the facts that
a) on i386, currency operations are calculated using the 80x87 floating point
unit
b) there is no separate abs() for curre
Den 04-03-2012 22:31, Zaher Dirkey skrev:
I found this problem in Delphi and FPC, please test it and confirm if
it is a bug.
---
program test_abs_curr;
uses
sysutils;
var
a: Currency;
begin
a := 674.59;
if a<>abs(-a) then
writeln('not equal')
else
writeln('equ
I found this problem in Delphi and FPC, please test it and confirm if it is
a bug.
---
program test_abs_curr;
uses
sysutils;
var
a: Currency;
begin
a := 674.59;
if a<>abs(-a) then
writeln('not equal')
else
writeln('equal');
end.
---
I am using l
26 matches
Mail list logo