TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ALL
from: ROBERT WILKINSON
date: 1997-10-02 08:25:00
subject: Floating Point

Hello!
I've come across a problem, and am hoping someone can point me in the 
direction
of a fix.
Am working on a billing program for the office where I work, and the plan is
once it's completed to release the program shareware.  The problem is that 
when
whole dollar amounts are entered it works as desireed, however with uneven
dollar amounts the decimal portion is being mangled.  For example 27.90 
entered
in an edit box is being recorded as 27.8999999999942 and 801.08 is being
recorded as 801.080000000075.  I'm not sure if it's in the StrToFloat 
unction
used to store the values or in the FloatToStr function to convert the 
numerical
values back to string in order to print out the statement.
BTW... this is in Delphi 1.  Any help would sure be appreciated.
Thanks in advance!
Bob
--- FalkenRdr V1.9d
---------------
* Origin: Kennewick,WA - (1:3407/7)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.