Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Tax Rate Formatting Leads to Inconsistent/Incorrect Tax Owed #10

Open
Eingang opened this issue Feb 1, 2019 · 1 comment

Comments

@Eingang
Copy link

Eingang commented Feb 1, 2019

Summary

Floating point mining tax rates are not displayed or applied consistently or correctly across Current Billing (Individual/Corp) and Past Billing (Individual and Corp).

Discussion

The problem's actually a little broader than summarized because it not only affects the display of Mining Tax and calculations based on it, but the display and calculation of other numeric values too. However, the Mining Tax one is the most egregious.

Let's start by looking at the Settings:
IRS Settings

Note that I did not change any of the settings after the Past Billing Invoices for the previous month were calculated. In the IRS Settings screenshot above, the Incentivized Settings-> Ore TAX Rate of 2.5% is correctly displayed and stored. It's also correctly displayed and used to calculate the Tax Owed on the Current Billing Summary (Corporation Mining) page, and the Mined Amount and Adjusted Value calculations are also correctly displayed and calculated, as seen below.

Current Billing (Corp)

After that, things get messy. On the Current Billing Summary (Individual Mining), the Mining Amount is displayed with 3 decimal places instead of 2. The Mining Tax value and resultant calculations and displays seem to be correct (see screenshow below).

Current Billing (Individual)

On the Past Billing Invoices (Corporation Mining) page, the Mined Amount, Adjusted Value, and Tax Owed are all correctly displayed with two decimal places. However, the Tax Rate of .2.5% has been rounded up to 3% on the display and 3% is what's been used to calculate the Tax Owed (see screenshot below).

Past Billing Invoices (Corp)

And just to be sure we've covered all the bases, on the Past Billing Invoices (Individual Mining) page, the Mining Amount has has 0 decimal places instead of 2. The Tax Rate has been rounded down to 0 places and then used to calculate the Tax Due. So instead of 2.5% being used, 2% was used as illustrated below.

Past Billing Invoices (Individual)

Problem Summary

Here's a handy summary of the issues on a page-by-page, variable-by-variable basis:

  • Current Billing Summary (Individual Mining) -> Mining Amount: Displayed with 3 decimal places instead of 2.
  • Past Billing Invoices (Corporation Mining) -> Tax Rate: Rounded up to 0 decimal places.
  • Past Billing Invoices (Corporation Mining) -> Tax Due: Incorrectly calculated using rounded up (to 0 decimal places) Tax Rate.
  • Past Billing Invoices (Individual Mining) -> Tax Rate: Incorrect displayed with 0 decimal places.
  • Past Billing Invoices (Individual Mining) -> Tax Due: Incorrectly calculated using rounded down (to 0 decimal places) Tax Rate.
  • Past Billing Invoices (Individual Mining) -> Mining Amount: Rounded to 0 decimal places instead of 2.

Other Comments

It's possible the Market Modifier for mining-related calculations is also off, but I used an integer for that and not a floating point value, so I can't tell. Likewise, I can't tell if the Tax Rate for PvE tax calculations is displayed incorrectly and then being used in the Tax Owed (PvE) calculation to provide an incorrect amount. The Total Bounties and Tax Owedfields on the Current and Past Billing pages for Corporation PvE at least have the correct number of decimal places displayed.

I'd suggest internally using floating point for all the calculations and using number-format() or printf() (or something similar) with relevant rounding functions then on numbers to be displayed. On the plus side, at least this stuff should be relatively easy to fix.

And finally, yes, I realize my Incentivized Settings -> Bounty Tax Rate is a whacko value. Fixed. (-:

@dysath
Copy link
Owner

dysath commented Feb 1, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants