apply_rescaler

Function apply_rescaler 

Source
fn apply_rescaler<I: DecimalType, O: DecimalType>(
    value: I::Native,
    output_precision: u8,
    f: impl Fn(I::Native) -> Option<O::Native>,
    f_infallible: Option<impl Fn(I::Native) -> O::Native>,
) -> Option<O::Native>
where I::Native: DecimalCast, O::Native: DecimalCast,
Expand description

Apply the rescaler function to the value. If the rescaler is infallible, use the infallible function. Otherwise, use the fallible function and validate the precision.