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

Decimals fixed for percentage #317

Merged
merged 2 commits into from Oct 5, 2018
Merged

Conversation

maxsam4
Copy link
Contributor

@maxsam4 maxsam4 commented Oct 5, 2018

Please check if the PR fulfills these requirements

  • The commit message follows our Submission guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Multiply by a fixed amount for percentage calculation

What is the current behavior?

% is calculated assuming token has 18 decimals

What is the new behavior?

% is calculated using 18 decimals no matter how many decimals the token has

Does this PR introduce a breaking change?

No

Any Other information:

We could have either changed the natspec comment to mention that percentage is in (10 ^ (decimals - 2)) or just use fixed (18) decimals for calculation. I went with the latter.

@satyamakgec satyamakgec merged commit 3b7be9c into development-1.5.0 Oct 5, 2018
@maxsam4 maxsam4 deleted the percentage-fix branch October 10, 2018 09:38
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.

None yet

2 participants