multiversx_sc_scenario::imports

Trait Decimals

Source
pub trait Decimals {
    // Required method
    fn num_decimals(&self) -> usize;

    // Provided method
    fn scaling_factor<M>(&self) -> ManagedRef<'static, M, BigUint<M>>
       where M: ManagedTypeApi { ... }
}
Expand description

Implemented by all decimal types usable in ManagedDecimal.

Required Methods§

Source

fn num_decimals(&self) -> usize

Number of decimals as variable.

Provided Methods§

Source

fn scaling_factor<M>(&self) -> ManagedRef<'static, M, BigUint<M>>
where M: ManagedTypeApi,

10^num_decimals, represented as a BigUint.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Decimals for usize

Implementors§

Source§

impl<const DECIMALS: usize> Decimals for ConstDecimals<DECIMALS>