Home > Blockchain >  How to get thirty percent of total amount in react native
How to get thirty percent of total amount in react native

Time:04-28

I have a available amount and total amount and I want to check available amount < 30% of total amount, please let me know how can I calculate this

CodePudding user response:

How I'd approach it, and this is really just math - so feel free to alter it as you need.

First, I'd find out what 30% of the total amount is;

var 30percentOfTotalAmount = (30 / 100) * totalAmount;

Then you'd just have a check against the available amount;

if(30percentOfTotalAmount <= availableAmount) {
  // Do your logic
}
  • Related