Skip to content

Conversation

@chedieck
Copy link
Collaborator

Related to #

Description

Fixes bug where many payments from last year wouldn't appear in the dashboard.

Test plan

Make sure that now the dashboard plots show # of payments & their revenue as expected.

Remarks

Technical explanation:
I assumed that the remainder operator in JS worked just like in Python, where the sign of the result is always the same as the sign of the divisor. In truth, the sign of the remainder division result in JS is equal to the dividend's, not the divisor's. To clarify:

image

... so this solves the issue by adding the divisor to the dividend, which will make it positive if it's negative (since it's never less than minus the divisor) or will have no effect if it is already positive.

@Klakurka Klakurka self-requested a review January 28, 2025 20:36
@Klakurka Klakurka merged commit 9a0d1a1 into master Jan 29, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants