float roundto error numeric field

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
ibosah
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 09.01.2008, 15:43

float roundto error numeric field

Post by ibosah »

field type numeric(18,4)


804533,289*
1994726,37=1604823767111,1298
zquery1.FieldByName('xx').AsFloat:=roundto(1604823767111,1298 ,-2);

1604823767111,1200
database commit after
1604823767111,1298

simpleroundto ,roundto,asnumeric
not ok;

found number test ed prg





1626800,4045
1551543,33=2524051316843,2796

1380010,7691*
474565,36=654905307441,8102

554270,3802*
1230910,93=682257469163,435586

1758713,9*
1626094,61=2859835193322,079

1380010,7691
474565,36=654905307441,8102


792037,798*
520022,12=411877174836,0901
User avatar
cipto_kh
Senior Boarder
Senior Boarder
Posts: 83
Joined: 28.09.2005, 11:22
Location: Indonesia
Contact:

Post by cipto_kh »

What database do you use and what type of field that you use?
ibosah
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 09.01.2008, 15:43

Post by ibosah »

Mysql
Postgree
firebird

Numeric(18,4)

2524051316843,2700
after commit
2524051316843,2796

411877174836,0900
after post
411877174836,0901

delphi2006 delphi2007
andy
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 20.12.2006, 17:54

Post by andy »

A type of (18,4) should be treated internally as Currency.
To avoid rounding problems.

But I don't know how to do it in Zeos.
Post Reply