icydb 0.189.2

IcyDB — A schema-first typed query engine and persistence runtime for Internet Computer canisters
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Module: base::helper
//!
//! Responsibility: shared base helper routines.
//! Does not own: domain validation policy or runtime persistence.
//! Boundary: supports base sanitizers and validators with local conversions.

use crate::{design::prelude::*, traits::NumericValue};

/// Convert an arbitrary numeric value into `Decimal`.
pub(crate) fn try_cast_decimal<N: NumericValue>(value: &N) -> Option<Decimal> {
    value.try_to_decimal()
}