[Lazarus] Problem rounding values at post

Joost van der Sluis joost at cnoc.nl
Wed Jun 4 15:50:47 CEST 2014


On 06/04/2014 01:20 PM, Daniel Erles wrote:
>
> Strange. I tried many values and y found this happens:
>
> ...
> inserting 0.06 stored as 0.0599
> 0.07 --> 0.07
> 0.08 --> 0.08
> 0.09 --> 0.0899
> 0.10 --> 0.10
> 0.11 --> 0.11
> 0.12 --> 0.1199
> 0.13 --> 0.13
> 0.14 --> 0.14
> 0.15 --> 0.1499
> 0.16 --> 0.16
> 0.17 --> 0.17
> 0.18 --> 0.1799
> ...
>
> there's a patron here. Could this be a bug ?
>

Yep, there's a pattern. And Mattias explained the pattern in his post.

And no, this is not a bug. But as designed. You'll need a TBCDField to 
read these decimal-type values. Or you can use a currency-field. (That 
is: if Zeos did implement those fields right)

Joost.






More information about the Lazarus mailing list