<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
<p>depending of the needs and the tool you may use string fields as well. (for example, Java will make the conversion in a numerical expression)</p>
<p>Philippe</p>
<p>Em 03.06.2014 17:39, Daniel Erles escreveu:</p>
<blockquote type="cite" style="padding-left:5px; border-left:#1010ff 2px solid; margin-left:5px; width:100%"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">
<div>Hello. </div>
<div>I have this problem: </div>
<div> </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> </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> </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> </div>
<div>Then, at the table, I see that the values are stored as follows: </div>
<div> </div>
<div>rTitle = <strong>0.1199</strong></div>
<div>rDiameter = 0.12 </div>
<div> </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> </div>
<div>Any idea?</div>
<div> </div>
<div>Tks. </div>
<div>Daniel.</div>
</div>
<br />
<pre>--
_______________________________________________
Lazarus mailing list
<a href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
</pre>
</blockquote>
<p> </p>
</body></html>