Function cfg_utils::math::to_ppm

source ·
pub const fn to_ppm(x: u128) -> FixedI64
Expand description

Converts the given number to parts per million

§Example

use sp_arithmetic::FixedI64;
use cfg_utils::math::to_ppm;

assert_eq!(to_ppm(3u128), FixedI64::from_rational(3, 1_000_000));