Skip to main content

is_within_single_unit_tolerance

Function is_within_single_unit_tolerance 

Source
pub fn is_within_single_unit_tolerance(
    value1: Decimal,
    value2: Decimal,
    precision: u8,
) -> bool
Expand description

Checks if two decimal values are within a single unit of tolerance for the given precision.

For integer precision (0), requires exact match. For fractional precision, allows difference of 1 unit at that precision.