8000 Allow greater than 100 for percentage · Issue #757 · dinerojs/dinero.js · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Allow greater than 100 for percentage #757
Open
@swordensen

Description

@swordensen

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0