Module decimal

Module decimal 

Source

Traitsยง

DecimalCast
A utility trait that provides checked conversions between decimal types inspired by NumCast

Functionsยง

apply_decimal_cast ๐Ÿ”’
apply_rescaler ๐Ÿ”’
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.
cast_decimal_to_decimal ๐Ÿ”’
cast_decimal_to_decimal_error ๐Ÿ”’
cast_decimal_to_decimal_same_type ๐Ÿ”’
cast_decimal_to_float ๐Ÿ”’
Cast a decimal array to a floating point array.
cast_decimal_to_integer ๐Ÿ”’
cast_floating_point_to_decimal ๐Ÿ”’
cast_string_to_decimal ๐Ÿ”’
Cast Utf8 to decimal
convert_to_bigger_or_equal_scale_decimal ๐Ÿ”’
convert_to_smaller_scale_decimal ๐Ÿ”’
generic_string_to_decimal_cast ๐Ÿ”’
make_downscaler ๐Ÿ”’
Construct closures to downscale decimals from (input_precision, input_scale) to (output_precision, output_scale).
make_upscaler ๐Ÿ”’
Construct closures to upscale decimals from (input_precision, input_scale) to (output_precision, output_scale).
parse_string_to_decimal_native ๐Ÿ”’
Parses given string to specified decimal native (i128/i256) based on given scale. Returns an Err if it cannot parse given string.
rescale_decimal
Rescales a decimal value from (input_precision, input_scale) to (output_precision, output_scale) and returns the converted number when it fits within the output precision.
string_to_decimal_cast ๐Ÿ”’
string_view_to_decimal_cast ๐Ÿ”’