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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I multiply money with a numeric value as follows.

Status
Not open for further replies.

delphiman

Programmer
Dec 13, 2001
422
ZA

I have Math in the Uses clause but the following nevertheless won't work. Can someone please tell me why?

Code:
  tblMStockItem.Value := FloatToCurr(tblMStockSqMtrs.Value * tblMStockCostPMetre.Value);
 
I haven't used Delphi for a long time, but:

It appears that you are trying to multiply a real (tblMStockSqMtrs.Value) by a currency (tblMStockCostPMetre.Value) and then assign the result to a currency (tblMStockItem.Value ).

Convert tblMStockCostPMetre.Value to a real (from memory using CurrToFloat) and then convert the result to currency
 
gcaramia

>What's your DB?


Parodox table "tblMStock".
Field "Item" is the required monetary value of the square area.
Field "SqMtrs" is obvious and a numric value
Field "CostPMetre" is obvious and a monetary value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top