<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi Daniel,<div><br></div><div>have you tried to use function Round in te assignment of the value??</div><div><br></div><div>Regards</div><div>Poncho<br><br><div><hr id="stopSpelling">Date: Tue, 3 Jun 2014 16:39:30 -0400<br>From: derles@gmail.com<br>To: lazarus@lists.lazarus.freepascal.org<br>Subject: [Lazarus] Problem rounding values at post<br><br><div dir="ltr"><div>Hello. </div><div>I have this problem: </div><div><br></div><div>My database (Firebird) has a table with the following fields: </div><div>... </div><div>rTitle DECIMAL(8,4) not null,</div><div>rDiameter DECIMAL(10,6) not null, </div>
<div>... </div><div><br></div><div>In my program I have a Form with a a TZTable object (ZEOS) called zData, bound to that table. </div><div>In a routine I have the following code: </div><div><br></div><div>zData.Insert;</div>
<div>...</div><div>zData.FieldByName('rTitle').AsFloat := 0.12; </div><div>zData.FieldByName('rDiameter').AsFloat := 0.12; </div><div>...</div><div>zData.Post;</div><div><br></div><div>Then, at the table, I see that the values are stored as follows: </div>
<div><br></div><div>rTitle = <b>0.1199</b></div><div>rDiameter = 0.12 </div><div><br></div><div>Do not know why rTitle is 0.1199 instead of 0.12 </div><div>I need the saved values are accurate. </div><div>I've tried AsFloat, AsCurrency, Value, always with the same result. </div>
<div><br></div><div>Any idea?</div><div><br></div><div>Tks. </div><div>Daniel.</div></div>
<br>--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</div></div> </div></body>
</html>