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

Allow greater than 100 for percentage #757

Open
swordensen opened this issue Sep 13, 2023 · 0 comments
Open

Allow greater than 100 for percentage #757

swordensen opened this issue Sep 13, 2023 · 0 comments

Comments

@swordensen
Copy link

swordensen commented Sep 13, 2023

Hi guys, I was wondering if it would be possible to allow for a greater than 100 for percentage.

For example; it would be helpful to calculate what 150% of some item would cost.

Currently the following throws an error:

   const itemCost = Dinero(500);
   const newItemCost = itemCost.percentage(150)
   const newItemCostValue = newItemCost.getAmount()

I would expect newItemCostValue to be 750 but right now I just get RangeError: You must provide a numeric value between 0 and 100

Thank you!

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

1 participant