Questions tagged [safe-math]
The safe-math tag has no usage guidance.
2
questions
1
vote
1
answer
28
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
...
8
votes
1
answer
61
views
How do you convert between Substrate specific types and Rust primitive types?
Using the Substrate blockchain framework, how can I convert between Substrate specific types and Rust primitive types and vice versa?
For example:
Convert a time (T::Moment) to a u64
Convert a u64 to ...