Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with floating error

Status
Not open for further replies.

Koos50

Technical User
Aug 16, 2010
7
ZA
Hi Guys,

I am battling with a error that I cannot get rid of.

I used a form with 3 DBEdits and a label to sum the totals entered into the DBEdits.

I used:

label33.Caption := ('R ')+FloatToStr(Table1.FieldByName('90days').AsFloat
+ Table1.FieldByName('60days').AsFloat + Table1.FieldByName('90days').AsFloat
+ Table1.FieldByName('120days').AsFloat);

The sum of the 3 DBEdits work perfect.Even when I add a new DBedit and set DBEdit63.text := Label33.Caption , in order to display the label's caption as the DBEdit.text it also works.

But when I want to post using the Navigator the new DBEdit.Text as 'totalouts' field I get the error:

Project.exe raised exception class EDatabaseError with message "R 1328.76' is not a valid floating point value for field ' Totalouts".

What am I missing or what?

Any help will be appreciated

Thanks.

 
The "R " part of Label33.caption renders it to not be a valid floating point value upon conversion. Text display values are always converted to their representative values when necessary.

Use the Copy function to remove that part when assigning to DBEdit.Text.

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top