Trait multiversx_sc_snippets::imports::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.

Object Safety§

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>