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

Add more useful properties #2

Open
sindresorhus opened this issue Oct 1, 2019 · 0 comments
Open

Add more useful properties #2

sindresorhus opened this issue Oct 1, 2019 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@sindresorhus
Copy link
Owner

Some ideas:

  • .clampedZeroToHundred which clamps the percentage to 0...100.
  • Percent.from(100, of: 200) //=> 50%
  • Find the original value before a percent increase. E.g. If a value is 120 after a 40% increase, what is the original value before the increase?
  • Find the original value before a percent decrease. E.g. If a value is 106 after a 12% decrease, what is the original value before the decrease?
  • "x IS y% OF". E.g. 67 is 90% of what?

What else?

@sindresorhus sindresorhus added the help wanted Extra attention is needed label Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant