Skip to main content

parse_string_to_decimal_native

Function parse_string_to_decimal_native 

pub fn parse_string_to_decimal_native<T>(
    value_str: &str,
    scale: usize,
) -> Result<<T as ArrowPrimitiveType>::Native, ArrowError>
where T: DecimalType,
👎Deprecated since 60.0.0:

Use arrow_cast::parse::parse_decimal instead

Expand description

Parses the given string as a decimal with the given scale, returning the unscaled representation in the decimal type’s native integer (e.g. i32 for Decimal32Type, i256 for Decimal256Type).

Returns an error if the input is not a valid decimal string, or if the scaled and rounded value does not fit the maximum precision of the decimal type. The caller is responsible for validating the result against any smaller target precision.