this is the price listino of the beach chalet ( June,May and september)
to create the price list I stored the cost in 4 fields: day, week, 15days, month and then the cost for the seasonal stay.
my problem is that the calc is never precise:
If a customer has stayed 3 days,
the function fetches the price for a week divides it by 7 to get the cost per day and then multiplies it for the number of days
example
Week 40 € / 7 = 5.71 €
5.71 * 3 = 17.14 €
and the calculation is wrong because it should be 18
in the function I enter the prices in an array and initially divide each price by the days
day 6 euro
week 40 euros
15 days 120 euros
month 180 euros
so I do
prz [1]:= day / 1
prz [2]:= week / 7
prz [3]:= 15days / 15
prz [4]:= month / 30
and then I multiply by the days
do case
case days <2
nPrice: = ngg * prz [1]
case days <7
nPrice: = ngg * prz [2]
case days <15
nPrice: = ngg * prz [3]
houses days <30
nPrice: = ngg * prz [4]
endcase
where is the error?