I get a strange calculating error, when I multiply two fields.
I use the calculation to calculate the price for cost, based on time used and hour rate. I want to be able to calculate the cost based on the actual minutes, which were necessary to do the work.
I have these fields:
hourRate currency field (manual input) tried also with a float to exclude error because of currency, same error
minutes integer (manual input) tried also with float, same error
hours float (calculated)
result currency (calculated) tried also with float, same error
no rounding, float has two digits decimal.
my formula:
1. Calculate the hours as decimal based on minutes
2. Multiply the hours value with the hourRate
The result is correct, if hours is full hour (1, 2 etc.). As soon as minutes calculate an hour with decimal fractions, the result is exactly 0,13 more than should be, so if the result calculated correctly would be 79,04 it results in 79,17.
I already tried with number\format but that function has no effect at all in this case.
Edit:
Tested in the demo version of espoCRM, same error. Nothing in error-log.
I use the calculation to calculate the price for cost, based on time used and hour rate. I want to be able to calculate the cost based on the actual minutes, which were necessary to do the work.
I have these fields:
hourRate currency field (manual input) tried also with a float to exclude error because of currency, same error
minutes integer (manual input) tried also with float, same error
hours float (calculated)
result currency (calculated) tried also with float, same error
no rounding, float has two digits decimal.
my formula:
1. Calculate the hours as decimal based on minutes
Code:
hours = minutes/60;
Code:
result = hours * hourRate;
I already tried with number\format but that function has no effect at all in this case.
Edit:
Tested in the demo version of espoCRM, same error. Nothing in error-log.
Comment