Questions tagged [safe-math]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
user avatar
  • 33
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 ...
user avatar
  • 9,195