Questions tagged [percent]
The percent tag has no usage guidance.
3 questions
1
vote
1
answer
252
views
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
...
4
votes
2
answers
428
views
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 ...
6
votes
3
answers
530
views
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 ...