Skip to main content

ToBigDecimal

Trait ToBigDecimal 

Source
pub trait ToBigDecimal {
    // Required method
    fn to_big_decimal(&self) -> BigDecimal;
}
Expand description

Trait for types that can be converted to BigDecimal

This trait provides a way to convert numeric types to BigDecimal for use in database operations. It’s used as a base trait for numeric operations.

Required Methods§

Source

fn to_big_decimal(&self) -> BigDecimal

Convert self to a BigDecimal

For numeric types, this should be a lossless conversion. For string types, this may parse and panic if the string is not a valid number.

Implementations on Foreign Types§

Source§

impl ToBigDecimal for &str

Source§

impl ToBigDecimal for &BigDecimal

Source§

impl ToBigDecimal for &BigInt

Source§

impl ToBigDecimal for i8

Source§

impl ToBigDecimal for i16

Source§

impl ToBigDecimal for i32

Source§

impl ToBigDecimal for i64

Source§

impl ToBigDecimal for i128

Source§

impl ToBigDecimal for isize

Source§

impl ToBigDecimal for u8

Source§

impl ToBigDecimal for u16

Source§

impl ToBigDecimal for u32

Source§

impl ToBigDecimal for u64

Source§

impl ToBigDecimal for u128

Source§

impl ToBigDecimal for usize

Source§

impl ToBigDecimal for String

Source§

impl ToBigDecimal for BigDecimal

Source§

impl ToBigDecimal for BigInt

Implementors§