[Lazarus] Problem rounding values at post

Poncho Velázquez poncho-velazquez at hotmail.com
Wed Jun 4 17:55:02 CEST 2014


Hi Daniel,
have you tried to use function Round in te assignment of the value??
RegardsPoncho

Date: Tue, 3 Jun 2014 16:39:30 -0400
From: derles at gmail.com
To: lazarus at lists.lazarus.freepascal.org
Subject: [Lazarus] Problem rounding values at post

Hello. I have this problem: 
My database (Firebird) has a table with the following fields: ... rTitle DECIMAL(8,4) not null,rDiameter DECIMAL(10,6) not null, 
... 
In my program I have a Form with a a TZTable object (ZEOS) called zData, bound to that table. In a routine I have the following code: 
zData.Insert;
...zData.FieldByName('rTitle').AsFloat := 0.12; zData.FieldByName('rDiameter').AsFloat := 0.12; ...zData.Post;
Then, at the table, I see that the values ​​are stored as follows: 

rTitle = 0.1199rDiameter = 0.12 
Do not know why rTitle is 0.1199 instead of 0.12 I need the saved values ​​are accurate. I've tried AsFloat, AsCurrency, Value, always with the same result. 

Any idea?
Tks. Daniel.

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140604/09a650d0/attachment-0003.html>


More information about the Lazarus mailing list