divide
Hello.
I??m using Delphi 7, Firebird 1.5 and FastReport 2.52.
I have frMemoView with the follow instruction:
FINAL_VALUE :=
[dmdatabase.cdsQryReports."PRICE"] / [dmdatabase.cdsQryReports."QUANTITY"]
EG :
[dmdatabase.cdsQryReports."PRICE"] = 10780000 AND
[dmdatabase.cdsQryReports." QUANTITY "] = 77
But the value of FINAL_VALUE is 14 not 140.000.
But the effect for this formula not for every record, just only 3 of 10 (example) that?s incorrect ?
Why is this happening ?.. ???
Please ....
Thank you for your help
Regards
######
I??m using Delphi 7, Firebird 1.5 and FastReport 2.52.
I have frMemoView with the follow instruction:
FINAL_VALUE :=
[dmdatabase.cdsQryReports."PRICE"] / [dmdatabase.cdsQryReports."QUANTITY"]
EG :
[dmdatabase.cdsQryReports."PRICE"] = 10780000 AND
[dmdatabase.cdsQryReports." QUANTITY "] = 77
But the value of FINAL_VALUE is 14 not 140.000.
But the effect for this formula not for every record, just only 3 of 10 (example) that?s incorrect ?
Why is this happening ?.. ???
Please ....
Thank you for your help
Regards
######
Comments
finalvalue := tn."fn"] / [tn."fn"
I have tried for your suggest but the value of FINAL_VALUE is not change yet, the value of FINAL_VALUE still 14 not 140.000
Format variable memo that I have used was
Custom format : #,##0.00
Decimal Digits : 2
Decimal Separator : .
Would you like to check again my formula. I wonder my formula or setting was not complete.
Thank you for your attention.
look at values
whole number / whole number
10780000 / 77 result is 140000
so your format string is incorrect
I've used the same format to show the value 10780000 in other memo and it shows correctly, which is : 10,780,000.00 exactly what i want.
But when i put a memo object with statement:
FINAL_VALUE :=
dmdatabase.cdsQryReports."PRICE"] / [dmdatabase.cdsQryReports."QUANTITY"
and for record with value 10780000 / 77 it show value of 14
I've tried many format string, including the default format and text only. It still the same, it will always shows 14 as value.
But with other value that show a result that is not a whole number, it will shows correctly, like this:
3635030 / 2.3120 = 700121.34
and it shows with the correct value which is 700,121.34
As i know, this should be formating problem. But i don't know what is wrong.
Can you help me, what am i doing wrong
Thank you for your help.
2 there is no way, if the db is returning the values you have stated above could the result be 14
1078 / 77 = 14