Questions tagged [percent]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer

How to get a percent portion of a balance?

I would like to divide a Balance into two parts. One is 10% of value and another part is 90% of the value. BalanceOf<T> is the Balance of a pallet. type Balance: AtLeast32BitUnsigned ...
  • 273
4 votes
1 answer

Can you use floating point numbers or math in the Runtime?

I would like to do some basic operations in the runtime like: let new_balance = .5 * old_balance; Or save a percentage value in the runtime storage. Or represent the balance of a user like: 3.141592 ...
  • 14.5k
6 votes
3 answers

What is Perbill and where should it be used?

Often times you'll see Perbill used throughout substrate. It stands for Parts per billion, and here's an example of it being used: parameter_types! { pub const DisabledValidatorsThreshold: Perbill ...