Keleo / kimai2-grandtotal

A plugin to import timesheet data from Kimai in GrandTotal
Other
1 stars 4 forks source link

Fixes a rate rounding problem in grand total #9

Closed aegluke closed 9 months ago

aegluke commented 9 months ago

Grandtotal doesn't import the hourly rate - only the cost and the minute. The hourly rate is calculated - this runs in rounding problems for rates not based on 60. This fix produces rates with higher precision if the calculated hourly rate contains more then 2 decimal places.

aegluke commented 9 months ago

before after

I'll try your solution. I made a mistake in testing ;)

kevinpapst commented 9 months ago

I don't use GrandTotal myself, so my calculation was just based on my own assumptions. And I always use 15min time rounding and better roundable hourly rates, to avoid rounding issues.

And my proposed changes are actually only code style. There is/should be no logic change.

kevinpapst commented 9 months ago

Are you done testing?

aegluke commented 9 months ago

I'm done with testing

kevinpapst commented 9 months ago

Thanks @aegluke 👍