Skip to main content

decode_quantity

Function decode_quantity 

Source
pub fn decode_quantity(
    bytes: &[u8],
    precision: u8,
    field: &'static str,
    row: usize,
) -> Result<Quantity, EncodingError>
Expand description

Decodes a [Quantity] from raw bytes with bounds validation.

Uses corrected raw values to handle floating-point precision errors in stored data. Sentinel values (QUANTITY_UNDEF) are preserved unchanged.

ยงErrors

Returns an EncodingError::ParseError if the quantity value is out of bounds.