Subject | Re: {Disarmed} Re: [firebird-support] How do I determine a percentage of a dollar amount? |
---|---|
Author | Alan J Davies |
Post date | 2011-07-11T17:34:01Z |
select 150.00 *(60/100)
from rdb$database
result = 0.00
select 150.00 *(60.00/100)
from rdb$database
result = 90.00
That should explain your problem - an integer value of 60 divided by 100
gives a (correct) integer value of 0.
Solution is simple - use a decimal value for :V_SETTLEMENT_PERCENTAGE in
your SP
Alan J Davies
Aldis
from rdb$database
result = 0.00
select 150.00 *(60.00/100)
from rdb$database
result = 90.00
That should explain your problem - an integer value of 60 divided by 100
gives a (correct) integer value of 0.
Solution is simple - use a decimal value for :V_SETTLEMENT_PERCENTAGE in
your SP
Alan J Davies
Aldis
On 11/07/2011 18:04, SoftTech wrote:
> WRITE_OFF_AMOUNT = ITEM_BAL_DUE * (:V_SETTLEMENT_PERCENTAGE / 100)