Skip to content

Commit

Permalink
Update per_thing docs (paritytech#4575)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
shawntabrizi and bkchr committed Jan 9, 2020
1 parent fc6b7e8 commit fb1f980
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions primitives/arithmetic/src/per_things.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) }

Expand Down

0 comments on commit fb1f980

Please sign in to comment.