mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 05:47:58 +00:00
Update per_thing docs (#4575)
* Update `per_thing` docs * Update primitives/arithmetic/src/per_things.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> * Update per_things.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
cc573bc106
commit
69245901dc
@@ -54,7 +54,7 @@ macro_rules! implement_per_thing {
|
||||
Self([parts, $max][(parts > $max) as usize])
|
||||
}
|
||||
|
||||
/// Converts from a percent. Equal to `x / 100`.
|
||||
/// Converts a percent into `Self`. Equal to `x / 100`.
|
||||
///
|
||||
/// This can be created at compile time.
|
||||
pub const fn from_percent(x: $type) -> Self {
|
||||
@@ -69,7 +69,7 @@ macro_rules! implement_per_thing {
|
||||
Self::from_rational_approximation(p, q)
|
||||
}
|
||||
|
||||
/// Converts a fraction into `Permill`.
|
||||
/// Converts a fraction into `Self`.
|
||||
#[cfg(feature = "std")]
|
||||
pub fn from_fraction(x: f64) -> Self { Self((x * ($max as f64)) as $type) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user